Package org.refcodes.textual
Class CaseStyleBuilderImpl
- java.lang.Object
-
- org.refcodes.textual.CaseStyleBuilderImpl
-
- 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
,CaseStyleBuilder
public class CaseStyleBuilderImpl extends java.lang.Object implements CaseStyleBuilder
The Class CaseStyleBuilderImpl.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.textual.CaseAccessor
CaseAccessor.CaseBuilder<B extends CaseAccessor.CaseBuilder<?>>, CaseAccessor.CaseMutator, CaseAccessor.CaseProperty
-
-
Constructor Summary
Constructors Constructor Description CaseStyleBuilderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Case
getCase()
Gets the currently setCase
being used.java.lang.String
getText()
void
setCase(Case aCase)
Sets theCase
to be used.void
setText(java.lang.String aText)
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 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 aText)
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 aText)
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 aText)
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()
).CaseStyleBuilder
withText(java.lang.String aText)
-
Methods inherited from interface org.refcodes.textual.CaseStyleBuilder
withCase
-
-
-
-
Method Detail
-
getText
public java.lang.String getText()
- Specified by:
getText
in interfaceorg.refcodes.mixin.TextAccessor
-
setText
public void setText(java.lang.String aText)
- Specified by:
setText
in interfaceorg.refcodes.mixin.TextAccessor.TextMutator
-
withText
public CaseStyleBuilder withText(java.lang.String aText)
- Specified by:
withText
in interfaceorg.refcodes.mixin.TextAccessor.TextBuilder<CaseStyleBuilder>
-
getCase
public Case getCase()
Gets the currently setCase
being used.- Specified by:
getCase
in interfaceCaseAccessor
- Returns:
- The currently configured
Case
s.
-
setCase
public void setCase(Case aCase)
Sets theCase
to be used.- Specified by:
setCase
in interfaceCaseAccessor.CaseMutator
- Parameters:
aCase
- TheCase
to be stored by theCase
property.
-
toCamelCase
public java.lang.String toCamelCase()
Converts the text as ofTextAccessor.getText()
to camel-case ("camelCase").- Specified by:
toCamelCase
in interfaceCaseStyleBuilder
- Returns:
- The camel-case representation of the according key.
-
toSnakeCase
public 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()
).- Specified by:
toSnakeCase
in interfaceCaseStyleBuilder
- Returns:
- The pascal-case representation of the according key.
-
toPascalCase
public java.lang.String toPascalCase()
Converts the key as ofTextAccessor.getText()
to pascal-case ("PascalCase").- Specified by:
toPascalCase
in interfaceCaseStyleBuilder
- Returns:
- The camel-case representation of the according key.
-
toKebabCase
public 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()
).- Specified by:
toKebabCase
in interfaceCaseStyleBuilder
- Returns:
- The kebab-case representation of the according key.
-
toCamelCase
public java.lang.String toCamelCase(java.lang.String aText)
Converts the provided key as ofTextAccessor.getText()
to camel-case ("camelCase").- Specified by:
toCamelCase
in interfaceCaseStyleBuilder
- Parameters:
aText
- The key to be converted.- Returns:
- The camel-case representation of the according key.
-
toSnakeCase
public java.lang.String toSnakeCase(java.lang.String aText)
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()
).- Specified by:
toSnakeCase
in interfaceCaseStyleBuilder
- Parameters:
aText
- The key to be converted.- Returns:
- The snake-case representation of the according key.
-
toPascalCase
public java.lang.String toPascalCase(java.lang.String aText)
Converts the provided key as ofTextAccessor.getText()
to pascal-case ("PascalCase").- Specified by:
toPascalCase
in interfaceCaseStyleBuilder
- Parameters:
aText
- The key to be converted.- Returns:
- The pascal-case representation of the according key.
-
toKebabCase
public java.lang.String toKebabCase(java.lang.String aText)
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()
).- Specified by:
toKebabCase
in interfaceCaseStyleBuilder
- Parameters:
aText
- The key to be converted.- Returns:
- The kebab-case representation of the according key.
-
-