java.lang.Object
org.refcodes.textual.CaseStyleBuilder
- All Implemented Interfaces:
org.refcodes.mixin.TextAccessor
,org.refcodes.mixin.TextAccessor.TextBuilder<CaseStyleBuilder>
,org.refcodes.mixin.TextAccessor.TextMutator
,org.refcodes.mixin.TextAccessor.TextProperty
,CaseAccessor
,CaseAccessor.CaseBuilder<CaseStyleBuilder>
,CaseAccessor.CaseMutator
,CaseAccessor.CaseProperty
public class CaseStyleBuilder
extends Object
implements org.refcodes.mixin.TextAccessor.TextProperty, org.refcodes.mixin.TextAccessor.TextBuilder<CaseStyleBuilder>, CaseAccessor.CaseProperty, CaseAccessor.CaseBuilder<CaseStyleBuilder>
Converts a text to the format of a
String
to the desired case. The
state of the Case
accessible via getCase()
has not an effect
on some of the methods. For example it has no effect on
toCamelCase()
, but it has an effect in toSnakeCase(String)
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.textual.CaseAccessor
CaseAccessor.CaseBuilder<B extends CaseAccessor.CaseBuilder<?>>, CaseAccessor.CaseMutator, CaseAccessor.CaseProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.TextAccessor
org.refcodes.mixin.TextAccessor.TextBuilder<B extends org.refcodes.mixin.TextAccessor.TextBuilder<B>>, org.refcodes.mixin.TextAccessor.TextMutator, org.refcodes.mixin.TextAccessor.TextProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
asKebabCase
(String aText, Case aCase) This method represents a shortcut for the instance methodtoKebabCase(String)
.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 String
asSnakeCase
(String aText, Case aCase) This method represents a shortcut for the instance methodtoSnakeCase(String)
.getCase()
Gets the currently setCase
being used.getText()
void
Sets theCase
to be used.void
Converts the text as ofgetText()
to camel-case ("camelCase").toCamelCase
(String aText) Converts the provided text as ofgetText()
to camel-case ("camelCase").Converts the text as ofgetText()
to kebab-case, either in upper case as of "KEBAB-CASE" or in lower-case as of "kebab-case", depending on theCase
property (as ofsetCase(Case)
andgetCase()
).toKebabCase
(String aText) Converts the provided text as ofgetText()
to kebab-case, either in upper case as of "KEBAB-CASE" or in lower-case as of "kebab-case", depending on theCase
property (as ofsetCase(Case)
andgetCase()
).Converts the text as ofgetText()
to pascal-case ("PascalCase").toPascalCase
(String aText) Converts the provided text as ofgetText()
to pascal-case ("PascalCase").Converts the text as ofgetText()
to snake-case, either in upper case as of "SNAKE_CASE" or in lower-case as of "snake_case", depending on theCase
property (as ofsetCase(Case)
andgetCase()
).toSnakeCase
(String aText) Converts the provided text as ofgetText()
to snake-case, either in upper case as of "SNAKE_CASE" or in lower-case as of "snake_case", depending on theCase
property (as ofsetCase(Case)
andgetCase()
).Sets the rowsCase
to use returns this builder as of the Builder-Pattern.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.textual.CaseAccessor.CaseProperty
letCase
Methods inherited from interface org.refcodes.mixin.TextAccessor.TextProperty
letText
-
Constructor Details
-
CaseStyleBuilder
public CaseStyleBuilder()
-
-
Method Details
-
getText
- Specified by:
getText
in interfaceorg.refcodes.mixin.TextAccessor
-
setText
- Specified by:
setText
in interfaceorg.refcodes.mixin.TextAccessor.TextMutator
-
withText
- Specified by:
withText
in interfaceorg.refcodes.mixin.TextAccessor.TextBuilder<CaseStyleBuilder>
-
getCase
Gets the currently setCase
being used.- Specified by:
getCase
in interfaceCaseAccessor
- Returns:
- The currently configured
Case
s.
-
setCase
Sets theCase
to be used.- Specified by:
setCase
in interfaceCaseAccessor.CaseMutator
- Parameters:
aCase
- TheCase
to be stored by theCase
property.
-
toCamelCase
Converts the text as ofgetText()
to camel-case ("camelCase").- Returns:
- The camel-case representation of the according text.
-
toSnakeCase
Converts the text as ofgetText()
to snake-case, either in upper case as of "SNAKE_CASE" or in lower-case as of "snake_case", depending on theCase
property (as ofsetCase(Case)
andgetCase()
).- Returns:
- The pascal-case representation of the according text.
-
toPascalCase
Converts the text as ofgetText()
to pascal-case ("PascalCase").- Returns:
- The camel-case representation of the according text.
-
toKebabCase
Converts the text as ofgetText()
to kebab-case, either in upper case as of "KEBAB-CASE" or in lower-case as of "kebab-case", depending on theCase
property (as ofsetCase(Case)
andgetCase()
).- Returns:
- The kebab-case representation of the according text.
-
toCamelCase
Converts the provided text as ofgetText()
to camel-case ("camelCase").- Parameters:
aText
- The text to be converted.- Returns:
- The camel-case representation of the according text.
-
toSnakeCase
Converts the provided text as ofgetText()
to snake-case, either in upper case as of "SNAKE_CASE" or in lower-case as of "snake_case", depending on theCase
property (as ofsetCase(Case)
andgetCase()
).- Parameters:
aText
- The text to be converted.- Returns:
- The snake-case representation of the according text.
-
toPascalCase
Converts the provided text as ofgetText()
to pascal-case ("PascalCase").- Parameters:
aText
- The text to be converted.- Returns:
- The pascal-case representation of the according text.
-
toKebabCase
Converts the provided text as ofgetText()
to kebab-case, either in upper case as of "KEBAB-CASE" or in lower-case as of "kebab-case", depending on theCase
property (as ofsetCase(Case)
andgetCase()
).- Parameters:
aText
- The text to be converted.- Returns:
- The kebab-case representation of the according text.
-
withCase
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
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
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.
-
asSnakeCase
This method represents a shortcut for the instance methodtoSnakeCase(String)
.- Parameters:
aText
- The text to be converted.aCase
- The case to use, either upper or lower.- Returns:
- The snake-case representation of the according text.
-
asPascalCase
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
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.
-
asKebabCase
This method represents a shortcut for the instance methodtoKebabCase(String)
.- Parameters:
aText
- The text to be converted.aCase
- The case to use, either upper or lower.- Returns:
- The "kebab-case" representation of the according text.
-