Package | Description |
---|---|
sirius.kernel.commons |
Provides common classes used by large parts of the framework.
|
Modifier and Type | Field and Description |
---|---|
static Amount |
Amount.MINUS_ONE
Representation of -1.00
|
static Amount |
Amount.NOTHING
Represents an missing number.
|
static Amount |
Amount.ONE
Representation of 1.00
|
static Amount |
Amount.ONE_HUNDRED
Representation of 100.00
|
static Amount |
Amount.TEN
Representation of 10.00
|
static Amount |
Amount.ZERO
Representation of 0.00
|
Modifier and Type | Method and Description |
---|---|
Amount |
Amount.add(Amount other)
Adds the given number to this, if other is not empty.
|
Amount |
Amount.asDecimal()
Converts a percent value into a decimal fraction i.e. 34 % to 0.34
Effectively this is
this / 100 |
Amount |
Amount.computeIfNull(Supplier<Amount> supplier)
If this actual number if empty, the given supplier is used to compute one.
|
Amount |
Amount.decreasePercent(Amount decrease)
Decreases this number by the given amount in percent.
|
Amount |
Amount.divideBy(Amount other)
Divides this by the given number.
|
Amount |
Amount.fill(Amount valueIfNothing)
If this actual number if empty, the given value will be returned.
|
Amount |
Value.getAmount()
Returns the Amount for the wrapped value.
|
Amount |
Amount.increasePercent(Amount increase)
Increases this number by the given amount in percent.
|
Amount |
Amount.max(Amount other)
Compares this amount against the given amount and returns the one with the higher value.
|
Amount |
Amount.min(Amount other)
Compares this amount against the given amount and returns the one with the lower value.
|
Amount |
Amount.multiplyPercent(Amount percent)
Used to multiply two percentages, like two discounts as if they where applied after each other.
|
Amount |
Amount.negate()
Negates this amount and returns the new amount.
|
static Amount |
Amount.of(BigDecimal amount)
Converts the given value into a number.
|
static Amount |
Amount.of(double amount)
Converts the given value into a number.
|
static Amount |
Amount.of(Double amount)
Converts the given value into a number.
|
static Amount |
Amount.of(int amount)
Converts the given value into a number.
|
static Amount |
Amount.of(Integer amount)
Converts the given value into a number.
|
static Amount |
Amount.of(long amount)
Converts the given value into a number.
|
static Amount |
Amount.of(Long amount)
Converts the given value into a number.
|
static Amount |
Amount.ofMachineString(String value)
Converts the given string into a number.
|
static Amount |
Amount.ofUserString(String value)
Converts the given string into a number which is formatted according the decimal symbols for the current locale.
|
Amount |
Amount.percentageDifferenceOf(Amount other)
Returns the increase in percent of this over other.
|
Amount |
Amount.percentageOf(Amount other)
Returns the ratio in percent from this to other.
|
Amount |
Amount.remainder(Amount other)
Returns a
Amount whose value is (this % other) . |
Amount |
Amount.round(int scale,
RoundingMode roundingMode)
Rounds the number according to the given format.
|
Amount |
Amount.round(NumberFormat format)
Rounds the number according to the given format.
|
Amount |
Amount.subtract(Amount other)
Subtracts the given number from this, if other is not empty.
|
Amount |
Amount.times(Amount other)
Multiplies the given number with this.
|
Amount |
Amount.toPercent()
Converts a given decimal fraction into a percent value i.e. 0.34 to 34 %.
|
Modifier and Type | Method and Description |
---|---|
Amount |
Amount.add(Amount other)
Adds the given number to this, if other is not empty.
|
int |
Amount.compareTo(Amount o)
Compares this amount against the given one.
|
Amount |
Amount.decreasePercent(Amount decrease)
Decreases this number by the given amount in percent.
|
Amount |
Amount.divideBy(Amount other)
Divides this by the given number.
|
Amount |
Amount.fill(Amount valueIfNothing)
If this actual number if empty, the given value will be returned.
|
Amount |
Amount.increasePercent(Amount increase)
Increases this number by the given amount in percent.
|
boolean |
Amount.isGreaterThan(Amount o)
Determines if this amount is greater than the given one.
|
boolean |
Amount.isGreaterThanOrEqual(Amount o)
Determines if this amount is greater than or equal to the given one.
|
boolean |
Amount.isLessThan(Amount o)
Determines if this amount is less than the given one.
|
boolean |
Amount.isLessThanOrEqual(Amount o)
Determines if this amount is less than or equal to the given one.
|
Amount |
Amount.max(Amount other)
Compares this amount against the given amount and returns the one with the higher value.
|
Amount |
Amount.min(Amount other)
Compares this amount against the given amount and returns the one with the lower value.
|
Amount |
Amount.multiplyPercent(Amount percent)
Used to multiply two percentages, like two discounts as if they where applied after each other.
|
Amount |
Amount.percentageDifferenceOf(Amount other)
Returns the increase in percent of this over other.
|
Amount |
Amount.percentageOf(Amount other)
Returns the ratio in percent from this to other.
|
Amount |
Amount.remainder(Amount other)
Returns a
Amount whose value is (this % other) . |
Amount |
Amount.subtract(Amount other)
Subtracts the given number from this, if other is not empty.
|
Amount |
Amount.times(Amount other)
Multiplies the given number with this.
|
Modifier and Type | Method and Description |
---|---|
Amount |
Amount.computeIfNull(Supplier<Amount> supplier)
If this actual number if empty, the given supplier is used to compute one.
|
Copyright © 2018. All rights reserved.