mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-15 18:00:24 -04:00
rename all packages and other names from bisq to haveno
This commit is contained in:
parent
ab0b9e3b77
commit
1a1fb130c0
1775 changed files with 14575 additions and 16767 deletions
68
core/src/main/java/haveno/core/monetary/MonetaryWrapper.java
Normal file
68
core/src/main/java/haveno/core/monetary/MonetaryWrapper.java
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* This file is part of Haveno.
|
||||
*
|
||||
* Haveno is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Haveno is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package haveno.core.monetary;
|
||||
|
||||
import org.bitcoinj.core.Monetary;
|
||||
import org.bitcoinj.utils.MonetaryFormat;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public abstract class MonetaryWrapper {
|
||||
private static final Logger log = LoggerFactory.getLogger(MonetaryWrapper.class);
|
||||
|
||||
/// Instance of Fiat or Altcoin
|
||||
protected final Monetary monetary;
|
||||
protected final MonetaryFormat fiatFormat = MonetaryFormat.FIAT.repeatOptionalDecimals(0, 0);
|
||||
protected final MonetaryFormat altCoinFormat = MonetaryFormat.FIAT.repeatOptionalDecimals(0, 0);
|
||||
|
||||
public MonetaryWrapper(Monetary monetary) {
|
||||
this.monetary = monetary;
|
||||
}
|
||||
|
||||
public Monetary getMonetary() {
|
||||
return monetary;
|
||||
}
|
||||
|
||||
public boolean isZero() {
|
||||
return monetary.getValue() == 0;
|
||||
}
|
||||
|
||||
public int smallestUnitExponent() {
|
||||
return monetary.smallestUnitExponent();
|
||||
}
|
||||
|
||||
public long getValue() {
|
||||
return monetary.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this)
|
||||
return true;
|
||||
if (o == null || o.getClass() != getClass())
|
||||
return false;
|
||||
final Monetary otherMonetary = ((MonetaryWrapper) o).getMonetary();
|
||||
return monetary.getValue() == otherMonetary.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (int) monetary.getValue();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue