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>
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)
.CaseAccessor.CaseBuilder<B extends CaseAccessor.CaseBuilder<?>>, CaseAccessor.CaseMutator, CaseAccessor.CaseProperty
Constructor | Description |
---|---|
CaseStyleBuilder() |
Modifier and Type | Method | Description |
---|---|---|
static String |
asCamelCase(String aText) |
This method represents a shortcut for the instance method
toCamelCase(String) though with default settings. |
static String |
asKebabCase(String aText) |
This method represents a shortcut for the instance method
toKebabCase(String) though with default settings. |
static String |
asKebabCase(String aText,
Case aCase) |
This method represents a shortcut for the instance method
toKebabCase(String) . |
static String |
asPascalCase(String aText) |
This method represents a shortcut for the instance method
toPascalCase(String) though with default settings. |
static String |
asSnakeCase(String aText) |
This method represents a shortcut for the instance method
toSnakeCase(String) though with default settings. |
static String |
asSnakeCase(String aText,
Case aCase) |
This method represents a shortcut for the instance method
toSnakeCase(String) . |
Case |
getCase() |
Gets the currently set
Case being used. |
String |
getText() |
|
void |
setCase(Case aCase) |
Sets the
Case to be used. |
void |
setText(String aText) |
|
String |
toCamelCase() |
Converts the text as of
getText() to camel-case ("camelCase"). |
String |
toCamelCase(String aText) |
Converts the provided text as of
getText() to camel-case
("camelCase"). |
String |
toKebabCase() |
Converts the text as of
getText() to kebab-case, either in upper
case as of "KEBAB-CASE" or in lower-case as of "kebab-case", depending on
the Case property (as of setCase(Case) and
getCase() ). |
String |
toKebabCase(String aText) |
Converts the provided text as of
getText() to kebab-case, either
in upper case as of "KEBAB-CASE" or in lower-case as of "kebab-case",
depending on the Case property (as of setCase(Case) and
getCase() ). |
String |
toPascalCase() |
Converts the text as of
getText() to pascal-case ("PascalCase"). |
String |
toPascalCase(String aText) |
Converts the provided text as of
getText() to pascal-case
("PascalCase"). |
String |
toSnakeCase() |
Converts the text as of
getText() to snake-case, either in upper
case as of "SNAKE_CASE" or in lower-case as of "snake_case", depending on
the Case property (as of setCase(Case) and
getCase() ). |
String |
toSnakeCase(String aText) |
Converts the provided text as of
getText() to snake-case, either
in upper case as of "SNAKE_CASE" or in lower-case as of "snake_case",
depending on the Case property (as of setCase(Case) and
getCase() ). |
CaseStyleBuilder |
withCase(Case aCase) |
Sets the rows
Case to use returns this builder as of the
Builder-Pattern. |
CaseStyleBuilder |
withText(String aText) |
letCase
public String getText()
getText
in interface org.refcodes.mixin.TextAccessor
public void setText(String aText)
setText
in interface org.refcodes.mixin.TextAccessor.TextMutator
public CaseStyleBuilder withText(String aText)
withText
in interface org.refcodes.mixin.TextAccessor.TextBuilder<CaseStyleBuilder>
public Case getCase()
Case
being used.getCase
in interface CaseAccessor
Case
s.public void setCase(Case aCase)
Case
to be used.setCase
in interface CaseAccessor.CaseMutator
aCase
- The Case
to be stored by the Case
property.public String toCamelCase()
getText()
to camel-case ("camelCase").public String toSnakeCase()
getText()
to snake-case, either in upper
case as of "SNAKE_CASE" or in lower-case as of "snake_case", depending on
the Case
property (as of setCase(Case)
and
getCase()
).public String toPascalCase()
getText()
to pascal-case ("PascalCase").public String toKebabCase()
getText()
to kebab-case, either in upper
case as of "KEBAB-CASE" or in lower-case as of "kebab-case", depending on
the Case
property (as of setCase(Case)
and
getCase()
).public String toCamelCase(String aText)
getText()
to camel-case
("camelCase").aText
- The text to be converted.public String toSnakeCase(String aText)
getText()
to snake-case, either
in upper case as of "SNAKE_CASE" or in lower-case as of "snake_case",
depending on the Case
property (as of setCase(Case)
and
getCase()
).aText
- The text to be converted.public String toPascalCase(String aText)
getText()
to pascal-case
("PascalCase").aText
- The text to be converted.public String toKebabCase(String aText)
getText()
to kebab-case, either
in upper case as of "KEBAB-CASE" or in lower-case as of "kebab-case",
depending on the Case
property (as of setCase(Case)
and
getCase()
).aText
- The text to be converted.public CaseStyleBuilder withCase(Case aCase)
Case
to use returns this builder as of the
Builder-Pattern.withCase
in interface CaseAccessor.CaseBuilder<CaseStyleBuilder>
aCase
- The Case
to be used when printing a row or the
header.CaseAccessor.CaseBuilder
instance to continue configuration.public static String asCamelCase(String aText)
toCamelCase(String)
though with default settings.aText
- The text to be converted.public static String asSnakeCase(String aText)
toSnakeCase(String)
though with default settings.aText
- The text to be converted.public static String asSnakeCase(String aText, Case aCase)
toSnakeCase(String)
.aText
- The text to be converted.aCase
- The case to use, either upper or lower.public static String asPascalCase(String aText)
toPascalCase(String)
though with default settings.aText
- The text to be converted.public static String asKebabCase(String aText)
toKebabCase(String)
though with default settings.aText
- The text to be converted.public static String asKebabCase(String aText, Case aCase)
toKebabCase(String)
.aText
- The text to be converted.aCase
- The case to use, either upper or lower.Copyright © 2021. All rights reserved.