From 6d21ca98a3945ab74b62cf2fc382bbdbd1b6dea8 Mon Sep 17 00:00:00 2001 From: freeman0432 Date: Mon, 5 Aug 2019 18:41:07 +0800 Subject: [PATCH] rename ALL CAPS method name to camelCase --- src/main/java/javax/money/Monetary.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/javax/money/Monetary.java b/src/main/java/javax/money/Monetary.java index cbfcac1c..279e2d63 100644 --- a/src/main/java/javax/money/Monetary.java +++ b/src/main/java/javax/money/Monetary.java @@ -41,7 +41,7 @@ public final class Monetary { /** * The used {@link javax.money.spi.MonetaryCurrenciesSingletonSpi} instance. */ - private static MonetaryCurrenciesSingletonSpi MONETARY_CURRENCIES_SINGLETON_SPI() { + private static MonetaryCurrenciesSingletonSpi monetaryCurrenciesSingletonSpi() { try { return Optional.ofNullable(Bootstrap .getService(MonetaryCurrenciesSingletonSpi.class)).orElseGet( @@ -384,7 +384,7 @@ public static boolean isAvailable(MonetaryAmountFactoryQuery query) { * @throws UnknownCurrencyException if no such currency exists. */ public static CurrencyUnit getCurrency(String currencyCode, String... providers) { - return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow( + return Optional.ofNullable(monetaryCurrenciesSingletonSpi()).orElseThrow( () -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup.")) .getCurrency(currencyCode, providers); } @@ -401,7 +401,7 @@ public static CurrencyUnit getCurrency(String currencyCode, String... providers) * @throws UnknownCurrencyException if no such currency exists. */ public static CurrencyUnit getCurrency(Locale locale, String... providers) { - return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow( + return Optional.ofNullable(monetaryCurrenciesSingletonSpi()).orElseThrow( () -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup.")) .getCurrency(locale, providers); } @@ -418,7 +418,7 @@ public static CurrencyUnit getCurrency(Locale locale, String... providers) { * @throws UnknownCurrencyException if no such currency exists. */ public static Set getCurrencies(Locale locale, String... providers) { - return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow( + return Optional.ofNullable(monetaryCurrenciesSingletonSpi()).orElseThrow( () -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup.")) .getCurrencies(locale, providers); } @@ -433,7 +433,7 @@ public static Set getCurrencies(Locale locale, String... providers * would return a result for the given code. */ public static boolean isCurrencyAvailable(String code, String... providers) { - return Objects.nonNull(MONETARY_CURRENCIES_SINGLETON_SPI()) && MONETARY_CURRENCIES_SINGLETON_SPI().isCurrencyAvailable(code, providers); + return Objects.nonNull(monetaryCurrenciesSingletonSpi()) && monetaryCurrenciesSingletonSpi().isCurrencyAvailable(code, providers); } /** @@ -446,7 +446,7 @@ public static boolean isCurrencyAvailable(String code, String... providers) { * result containing a currency with the given code. */ public static boolean isCurrencyAvailable(Locale locale, String... providers) { - return Objects.nonNull(MONETARY_CURRENCIES_SINGLETON_SPI()) && MONETARY_CURRENCIES_SINGLETON_SPI().isCurrencyAvailable(locale, providers); + return Objects.nonNull(monetaryCurrenciesSingletonSpi()) && monetaryCurrenciesSingletonSpi().isCurrencyAvailable(locale, providers); } /** @@ -456,7 +456,7 @@ public static boolean isCurrencyAvailable(Locale locale, String... providers) { * @return the list of known currencies, never null. */ public static Collection getCurrencies(String... providers) { - return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow( + return Optional.ofNullable(monetaryCurrenciesSingletonSpi()).orElseThrow( () -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup.")) .getCurrencies(providers); } @@ -468,7 +468,7 @@ public static Collection getCurrencies(String... providers) { * @return the list of known currencies, never null. */ public static CurrencyUnit getCurrency(CurrencyQuery query) { - return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow( + return Optional.ofNullable(monetaryCurrenciesSingletonSpi()).orElseThrow( () -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup.")) .getCurrency(query); } @@ -481,7 +481,7 @@ public static CurrencyUnit getCurrency(CurrencyQuery query) { * @return the list of known currencies, never null. */ public static Collection getCurrencies(CurrencyQuery query) { - return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow( + return Optional.ofNullable(monetaryCurrenciesSingletonSpi()).orElseThrow( () -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup.")) .getCurrencies(query); } @@ -492,7 +492,7 @@ public static Collection getCurrencies(CurrencyQuery query) { * @return the list of known currencies, never null. */ public static Set getCurrencyProviderNames() { - return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow( + return Optional.ofNullable(monetaryCurrenciesSingletonSpi()).orElseThrow( () -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup.")) .getProviderNames(); } @@ -504,7 +504,7 @@ public static Set getCurrencyProviderNames() { * @return the ordered list provider names, modelling the default provider chain used, never null. */ public static List getDefaultCurrencyProviderChain() { - return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow( + return Optional.ofNullable(monetaryCurrenciesSingletonSpi()).orElseThrow( () -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup.")) .getDefaultProviderChain(); }