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 String
asCamelCase(String aText)
This method represents a shortcut for the instance methodtoCamelCase(String)
though with default settings.static String
asKebabCase(String aText)
This method represents a shortcut for the instance methodtoKebabCase(String)
though with default settings.static String
asPascalCase(String aText)
This method represents a shortcut for the instance methodtoPascalCase(String)
though with default settings.static String
asSnakeCase(String aText)
This method represents a shortcut for the instance methodtoSnakeCase(String)
though with default settings.static CaseStyleBuilder
build()
This is a convenience method for easily instantiating the according builder.String
toCamelCase()
Converts the text as ofTextAccessor.getText()
to camel-case ("camelCase").String
toCamelCase(String aText)
Converts the provided text as ofTextAccessor.getText()
to camel-case ("camelCase").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()
).String
toKebabCase(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()
).String
toPascalCase()
Converts the text as ofTextAccessor.getText()
to pascal-case ("PascalCase").String
toPascalCase(String aText)
Converts the provided text as ofTextAccessor.getText()
to pascal-case ("PascalCase").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()
).String
toSnakeCase(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
String toCamelCase()
Converts the text as ofTextAccessor.getText()
to camel-case ("camelCase").- Returns:
- The camel-case representation of the according text.
-
toPascalCase
String toPascalCase()
Converts the text as ofTextAccessor.getText()
to pascal-case ("PascalCase").- Returns:
- The camel-case representation of the according text.
-
toSnakeCase
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
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
String toCamelCase(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
String toPascalCase(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
String toSnakeCase(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
String toKebabCase(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 String asCamelCase(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 String asSnakeCase(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 String asPascalCase(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 String asKebabCase(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.
-
build
static CaseStyleBuilder build()
This is a convenience method for easily instantiating the according builder.- Returns:
- an instance (using a default implementation) of this builder
-
-