Module java.money
Package javax.money

Class RoundingQueryBuilder

    • Method Detail

      • setRoundingName

        public RoundingQueryBuilder setRoundingName​(java.lang.String roundingName)
        Sets the rounding names of the MonetaryRounding instances. This method allows to access the MonetaryRounding instances by passing a name, which most of the time identifies a certain rounding instance. Each entry is first matched as name on equality. If no instance with such a name exists, the value passed is interpreted as a regular expression to lookup roundings.
        Parameters:
        roundingName - the (custom) rounding name expression, not null.
        Returns:
        this instance for chaining
      • setScale

        public RoundingQueryBuilder setScale​(int scale)
        Sets the target scale. This allows to define the scale required. If not specified as additional attribute, by default, RoundingMode.HALF_EVEN is used hereby.
        Parameters:
        scale - the target scale, >0.
        Returns:
        this instance for chaining
      • setCurrency

        public RoundingQueryBuilder setCurrency​(CurrencyUnit currencyUnit)
        Sets the target CurrencyUnit, which defines a rounding targeting a concrete CurrencyUnit. Typically this determines all other properties, such as scale and the concrete rounding algorithm. With rounding names, depending on the implementation, additional subselections are possible. Similarly additional attributes can be used to select special rounding instances, e.g. for cash rounding.
        Parameters:
        currencyUnit - the target CurrencyUnit not null.
        Returns:
        this instance for chaining