Top Description Constructors Methods
org.javamoney.moneta.function

pack-priv final Class ExtractorMinorPartOperator

extends Object
implements MonetaryOperator
Class Inheritance
All Implemented Interfaces
javax.money.MonetaryOperator
Imports
java.math.BigDecimal, .RoundingMode, java.util.Objects, javax.money.MonetaryAmount, .MonetaryOperator

This class allows to extract the minor part of a MonetaryAmount instance.
Authors
Anatole Tresch, Otavio Santana

Constructor Summary

AccessConstructor and Description
pack-priv
ExtractorMinorPartOperator()

Package private constructor used from MonetaryFunctions.

Method Summary

Modifier and TypeMethod and Description
public MonetaryAmount

Returns:

the minor units part of the amount, never null
apply
(MonetaryAmount amount)

Implements javax.money.MonetaryOperator.apply.

Gets the minor part of a MonetaryAmount with the same scale.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ExtractorMinorPartOperatorback to summary
pack-priv ExtractorMinorPartOperator()

Package private constructor used from MonetaryFunctions.

Method Detail

applyback to summary
public MonetaryAmount apply(MonetaryAmount amount)

Implements javax.money.MonetaryOperator.apply.

Gets the minor part of a MonetaryAmount with the same scale.

This returns the monetary amount in terms of the minor units of the currency, truncating the whole part if necessary. For example, 'EUR 2.35' will return 'EUR 0.35', and 'BHD -1.345' will return 'BHD -0.345'.

This is returned as a MonetaryAmount rather than a BigDecimal . This is to allow further calculations to be performed on the result. Should you need a BigDecimal, simply call asType(BigDecimal.class).

Returns:MonetaryAmount

the minor units part of the amount, never null

Annotations
@Override