Class LowerCaseRule
java.lang.Object
com.streamconverter.command.rule.impl.string.LowerCaseRule
- All Implemented Interfaces:
IRule
Converts strings to lowercase.
This rule converts all uppercase letters in the input string to lowercase using the specified locale or the default locale if none is specified.
Examples:
"HELLO"
→"hello"
"Hello World"
→"hello world"
"XMLHttpRequest"
→"xmlhttprequest"
Usage:
IRule rule = new LowerCaseRule();
IRule localeRule = new LowerCaseRule(Locale.ENGLISH);
IStreamCommand command = JsonNavigateCommand.create("$.name", rule);
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a LowerCaseRule using the default locale.LowerCaseRule
(Locale locale) Creates a LowerCaseRule using the specified locale. -
Method Summary
-
Constructor Details
-
LowerCaseRule
public LowerCaseRule()Creates a LowerCaseRule using the default locale. -
LowerCaseRule
Creates a LowerCaseRule using the specified locale.- Parameters:
locale
- the locale to use for case conversion- Throws:
IllegalArgumentException
- if locale is null
-
-
Method Details
-
apply
Description copied from interface:IRule
ルールの適用を実行します。このメソッドは、ストリーム変換の際にルールを適用するために使用されます。 具体的なルールの実装は、このメソッドをオーバーライドして定義します。 変換対象とする箇所を特定したあとにこのメソッドを呼び出すことを想定しています。
-
getLocale
Gets the locale used for case conversion.- Returns:
- the locale
-
toString
-
equals
-
hashCode
-