This class has utility queries, MonetaryQuery, to MonetaryAmount.
MonetaryAmount monetaryAmount = Money.parse("EUR 2.35");
Long result = monetaryAmount.query(query);// 2L
Or using:
MonetaryAmount monetaryAmount = Money.parse("EUR 2.35");
Long result = query.queryFrom(monetaryAmount);// 2L
MonetaryAmount#query(MonetaryQuery), MonetaryQuery, MonetaryQuery#queryFrom(MonetaryAmount)
| Modifier and Type | Field and Description |
|---|---|
| private static final ConvertMinorPartQuery | |
| private static final ExtractorMajorPartQuery | |
| private static final ExtractorMinorPartQuery |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static MonetaryQuery | |
| public static MonetaryQuery | |
| public static MonetaryQuery |
| CONVERT_MINOR_PART | back to summary |
|---|---|
| private static final ConvertMinorPartQuery CONVERT_MINOR_PART | |
| EXTRACTOR_MAJOR_PART | back to summary |
|---|---|
| private static final ExtractorMajorPartQuery EXTRACTOR_MAJOR_PART | |
| EXTRACTOR_MINOR_PART | back to summary |
|---|---|
| private static final ExtractorMinorPartQuery EXTRACTOR_MINOR_PART | |
| MonetaryQueries | back to summary |
|---|---|
| private MonetaryQueries() | |
| convertMinorPart | back to summary |
|---|---|
| public static MonetaryQuery Convert to minor part a This returns the monetary amount in terms of the minor units of the currency, truncating the amount if necessary. For example, 'EUR 2.35' will return 235, and 'BHD -1.345' will return -1345.
{
| |
| extractMajorPart | back to summary |
|---|---|
| public static MonetaryQuery Allows to extract the major part of a For example, 'EUR 2.35' will return 2, and 'BHD -1.345' will return -1.
{
| |
| extractMinorPart | back to summary |
|---|---|
| public static MonetaryQuery Convert to minor part a 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 35, and 'BHD -1.345' will return -345.
{
| |