Package org.refcodes.textual
Interface CaseStyleBuilder
-
- All Superinterfaces:
CaseAccessor
,CaseAccessor.CaseBuilder<CaseStyleBuilder>
,CaseAccessor.CaseMutator
,CaseAccessor.CaseProperty
,org.refcodes.mixin.TextAccessor
,org.refcodes.mixin.TextAccessor.TextBuilder<CaseStyleBuilder>
,org.refcodes.mixin.TextAccessor.TextMutator
,org.refcodes.mixin.TextAccessor.TextProperty
- All Known Implementing Classes:
CaseStyleBuilderImpl
public interface CaseStyleBuilder extends org.refcodes.mixin.TextAccessor.TextProperty, org.refcodes.mixin.TextAccessor.TextBuilder<CaseStyleBuilder>, CaseAccessor.CaseProperty, CaseAccessor.CaseBuilder<CaseStyleBuilder>
Converts a key to the format of aString
to the desired case. The state of theCase
accessible viaCaseAccessor.getCase()
has not an effect on some of the methods. For example it has no effect ontoCamelCase()
, but it has an effect intoSnakeCase(String)
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.textual.CaseAccessor
CaseAccessor.CaseBuilder<B extends CaseAccessor.CaseBuilder<?>>, CaseAccessor.CaseMutator, CaseAccessor.CaseProperty
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.String
toCamelCase()
Converts the text as ofTextAccessor.getText()
to camel-case ("camelCase").java.lang.String
toCamelCase(java.lang.String aKey)
Converts the provided key as ofTextAccessor.getText()
to camel-case ("camelCase").java.lang.String
toKebabCase()
Converts the key as ofTextAccessor.getText()
to kebab-case, either in upper case as of "KEBAB-CASE" or in lower-case as of "kebab-case", depending on theCase
property (as ofCaseAccessor.CaseMutator.setCase(Case)
andCaseAccessor.getCase()
).java.lang.String
toKebabCase(java.lang.String aKey)
Converts the provided key as ofTextAccessor.getText()
to kebab-case, either in upper case as of "KEBAB-CASE" or in lower-case as of "kebab-case", depending on theCase
property (as ofCaseAccessor.CaseMutator.setCase(Case)
andCaseAccessor.getCase()
).java.lang.String
toPascalCase()
Converts the key as ofTextAccessor.getText()
to pascal-case ("PascalCase").java.lang.String
toPascalCase(java.lang.String aKey)
Converts the provided key as ofTextAccessor.getText()
to pascal-case ("PascalCase").java.lang.String
toSnakeCase()
Converts the key as ofTextAccessor.getText()
to snake-case, either in upper case as of "SNAKE_CASE" or in lower-case as of "snake_case", depending on theCase
property (as ofCaseAccessor.CaseMutator.setCase(Case)
andCaseAccessor.getCase()
).java.lang.String
toSnakeCase(java.lang.String aKey)
Converts the provided key as ofTextAccessor.getText()
to snake-case, either in upper case as of "SNAKE_CASE" or in lower-case as of "snake_case", depending on theCase
property (as ofCaseAccessor.CaseMutator.setCase(Case)
andCaseAccessor.getCase()
).default CaseStyleBuilder
withCase(Case aCase)
Sets the rowsCase
to use returns this builder as of the Builder-Pattern.-
Methods inherited from interface org.refcodes.textual.CaseAccessor
getCase
-
Methods inherited from interface org.refcodes.textual.CaseAccessor.CaseMutator
setCase
-
-
-
-
Method Detail
-
toCamelCase
java.lang.String toCamelCase()
Converts the text as ofTextAccessor.getText()
to camel-case ("camelCase").- Returns:
- The camel-case representation of the according key.
-
toPascalCase
java.lang.String toPascalCase()
Converts the key as ofTextAccessor.getText()
to pascal-case ("PascalCase").- Returns:
- The camel-case representation of the according key.
-
toSnakeCase
java.lang.String toSnakeCase()
Converts the key as ofTextAccessor.getText()
to snake-case, either in upper case as of "SNAKE_CASE" or in lower-case as of "snake_case", depending on theCase
property (as ofCaseAccessor.CaseMutator.setCase(Case)
andCaseAccessor.getCase()
).- Returns:
- The pascal-case representation of the according key.
-
toKebabCase
java.lang.String toKebabCase()
Converts the key as ofTextAccessor.getText()
to kebab-case, either in upper case as of "KEBAB-CASE" or in lower-case as of "kebab-case", depending on theCase
property (as ofCaseAccessor.CaseMutator.setCase(Case)
andCaseAccessor.getCase()
).- Returns:
- The kebab-case representation of the according key.
-
toCamelCase
java.lang.String toCamelCase(java.lang.String aKey)
Converts the provided key as ofTextAccessor.getText()
to camel-case ("camelCase").- Parameters:
aKey
- The key to be converted.- Returns:
- The camel-case representation of the according key.
-
toPascalCase
java.lang.String toPascalCase(java.lang.String aKey)
Converts the provided key as ofTextAccessor.getText()
to pascal-case ("PascalCase").- Parameters:
aKey
- The key to be converted.- Returns:
- The pascal-case representation of the according key.
-
toSnakeCase
java.lang.String toSnakeCase(java.lang.String aKey)
Converts the provided key as ofTextAccessor.getText()
to snake-case, either in upper case as of "SNAKE_CASE" or in lower-case as of "snake_case", depending on theCase
property (as ofCaseAccessor.CaseMutator.setCase(Case)
andCaseAccessor.getCase()
).- Parameters:
aKey
- The key to be converted.- Returns:
- The snake-case representation of the according key.
-
toKebabCase
java.lang.String toKebabCase(java.lang.String aKey)
Converts the provided key as ofTextAccessor.getText()
to kebab-case, either in upper case as of "KEBAB-CASE" or in lower-case as of "kebab-case", depending on theCase
property (as ofCaseAccessor.CaseMutator.setCase(Case)
andCaseAccessor.getCase()
).- Parameters:
aKey
- The key to be converted.- Returns:
- The kebab-case representation of the according key.
-
withCase
default CaseStyleBuilder withCase(Case aCase)
Sets the rowsCase
to use returns this builder as of the Builder-Pattern.- Specified by:
withCase
in interfaceCaseAccessor.CaseBuilder<CaseStyleBuilder>
- Parameters:
aCase
- TheCase
to be used when printing a row or the header.- Returns:
- This
CaseAccessor.CaseBuilder
instance to continue configuration.
-
-