Querying/Operation on MonetaryAmount
MonetaryOperator
and MonetaryQuery
are functional interfaces. They provide abstraction for querying and operating on monetary values like conversions and retrieving the fractional parts (cents).
@FunctionalInterface
public interface MonetaryOperator{
MonetaryAmount apply(MonetaryAmount amount);
}
@FunctionalInterface
public interface MonetaryQuery<R>{
R queryFrom(MonetaryAmount amount);
}