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 text 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 Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static java.lang.String
asCamelCase(java.lang.String aText)
This method represents a shortcut for the instance methodtoCamelCase(String)
though with default settings.static java.lang.String
asKebabCase(java.lang.String aText)
This method represents a shortcut for the instance methodtoKebabCase(String)
though with default settings.static java.lang.String
asPascalCase(java.lang.String aText)
This method represents a shortcut for the instance methodtoPascalCase(String)
though with default settings.static java.lang.String
asSnakeCase(java.lang.String aText)
This method represents a shortcut for the instance methodtoSnakeCase(String)
though with default settings.java.lang.String
toCamelCase()
Converts the text as ofTextAccessor.getText()
to camel-case ("camelCase").java.lang.String
toCamelCase(java.lang.String aText)
Converts the provided text as ofTextAccessor.getText()
to camel-case ("camelCase").java.lang.String
toKebabCase()
Converts the text 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 aText)
Converts the provided text 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 text as ofTextAccessor.getText()
to pascal-case ("PascalCase").java.lang.String
toPascalCase(java.lang.String aText)
Converts the provided text as ofTextAccessor.getText()
to pascal-case ("PascalCase").java.lang.String
toSnakeCase()
Converts the text 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 aText)
Converts the provided text 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 text.
-
toPascalCase
java.lang.String toPascalCase()
Converts the text as ofTextAccessor.getText()
to pascal-case ("PascalCase").- Returns:
- The camel-case representation of the according text.
-
toSnakeCase
java.lang.String toSnakeCase()
Converts the text 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 text.
-
toKebabCase
java.lang.String toKebabCase()
Converts the text 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 text.
-
toCamelCase
java.lang.String toCamelCase(java.lang.String aText)
Converts the provided text as ofTextAccessor.getText()
to camel-case ("camelCase").- Parameters:
aText
- The text to be converted.- Returns:
- The camel-case representation of the according text.
-
toPascalCase
java.lang.String toPascalCase(java.lang.String aText)
Converts the provided text as ofTextAccessor.getText()
to pascal-case ("PascalCase").- Parameters:
aText
- The text to be converted.- Returns:
- The pascal-case representation of the according text.
-
toSnakeCase
java.lang.String toSnakeCase(java.lang.String aText)
Converts the provided text 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:
aText
- The text to be converted.- Returns:
- The snake-case representation of the according text.
-
toKebabCase
java.lang.String toKebabCase(java.lang.String aText)
Converts the provided text 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:
aText
- The text to be converted.- Returns:
- The kebab-case representation of the according text.
-
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.
-
asCamelCase
static java.lang.String asCamelCase(java.lang.String aText)
This method represents a shortcut for the instance methodtoCamelCase(String)
though with default settings.- Parameters:
aText
- The text to be converted.- Returns:
- The camel-case representation of the according text.
-
asSnakeCase
static java.lang.String asSnakeCase(java.lang.String aText)
This method represents a shortcut for the instance methodtoSnakeCase(String)
though with default settings.- Parameters:
aText
- The text to be converted.- Returns:
- The snake-case representation of the according text.
-
asPascalCase
static java.lang.String asPascalCase(java.lang.String aText)
This method represents a shortcut for the instance methodtoPascalCase(String)
though with default settings.- Parameters:
aText
- The text to be converted.- Returns:
- The pascal-case representation of the according text.
-
asKebabCase
static java.lang.String asKebabCase(java.lang.String aText)
This method represents a shortcut for the instance methodtoKebabCase(String)
though with default settings.- Parameters:
aText
- The text to be converted.- Returns:
- The kebab-case representation of the according text.
-
-