Class SnakeToCamelCaseRule
java.lang.Object
com.streamconverter.command.rule.impl.casing.SnakeToCamelCaseRule
- All Implemented Interfaces:
IRule
Transforms snake_case strings to camelCase format.
This rule converts strings from snake_case notation to camelCase notation by removing underscores and capitalizing the first letter of each word after the first.
Examples:
user_name
→userName
first_name
→firstName
user_account_id
→userAccountId
xml_http_request
→xmlHttpRequest
Usage:
IRule rule = SnakeToCamelCaseRule.builder().build();
IStreamCommand command = JsonNavigateCommand.create("$.user_name", rule);
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder class for SnakeToCamelCaseRule configuration. -
Method Summary
Modifier and TypeMethodDescriptionルールの適用を実行します。static SnakeToCamelCaseRule.Builder
builder()
Creates a builder for configuring the SnakeToCamelCaseRule.static SnakeToCamelCaseRule
create()
Creates a SnakeToCamelCaseRule with default settings (camelCase, not PascalCase).static SnakeToCamelCaseRule
Creates a SnakeToCamelCaseRule that produces PascalCase output.toString()
-
Method Details
-
apply
Description copied from interface:IRule
ルールの適用を実行します。このメソッドは、ストリーム変換の際にルールを適用するために使用されます。 具体的なルールの実装は、このメソッドをオーバーライドして定義します。 変換対象とする箇所を特定したあとにこのメソッドを呼び出すことを想定しています。
-
builder
Creates a builder for configuring the SnakeToCamelCaseRule.- Returns:
- new builder instance
-
create
Creates a SnakeToCamelCaseRule with default settings (camelCase, not PascalCase).- Returns:
- new rule instance with default configuration
-
createPascalCase
Creates a SnakeToCamelCaseRule that produces PascalCase output.- Returns:
- new rule instance configured for PascalCase
-
toString
-