public interface CaseStyleBuilder extends 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 CaseAccessor.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)
.org.refcodes.mixin.TextAccessor.TextBuilder<B extends org.refcodes.mixin.TextAccessor.TextBuilder<B>>, org.refcodes.mixin.TextAccessor.TextMutator, org.refcodes.mixin.TextAccessor.TextProperty
CaseAccessor.CaseBuilder<B extends CaseAccessor.CaseBuilder<?>>, CaseAccessor.CaseMutator, CaseAccessor.CaseProperty
Modifier and Type | Method and Description |
---|---|
String |
toCamelCase()
Converts the text as of
TextAccessor.getText() to camel-case ("camelCase"). |
String |
toCamelCase(String aKey)
Converts the provided key as of
TextAccessor.getText() to camel-case
("camelCase"). |
String |
toKebabCase()
Converts the key as of
TextAccessor.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 CaseAccessor.CaseMutator.setCase(Case) and
CaseAccessor.getCase() ). |
String |
toKebabCase(String aKey)
Converts the provided key as of
TextAccessor.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 CaseAccessor.CaseMutator.setCase(Case) and
CaseAccessor.getCase() ). |
String |
toPascalCase()
Converts the key as of
TextAccessor.getText() to pascal-case ("PascalCase"). |
String |
toPascalCase(String aKey)
Converts the provided key as of
TextAccessor.getText() to pascal-case
("PascalCase"). |
String |
toSnakeCase()
Converts the key as of
TextAccessor.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 CaseAccessor.CaseMutator.setCase(Case) and
CaseAccessor.getCase() ). |
String |
toSnakeCase(String aKey)
Converts the provided key as of
TextAccessor.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 CaseAccessor.CaseMutator.setCase(Case) and
CaseAccessor.getCase() ). |
default CaseStyleBuilder |
withCase(Case aCase)
With case.
|
getCase
setCase
String toCamelCase()
TextAccessor.getText()
to camel-case ("camelCase").String toPascalCase()
TextAccessor.getText()
to pascal-case ("PascalCase").String toSnakeCase()
TextAccessor.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 CaseAccessor.CaseMutator.setCase(Case)
and
CaseAccessor.getCase()
).String toKebabCase()
TextAccessor.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 CaseAccessor.CaseMutator.setCase(Case)
and
CaseAccessor.getCase()
).String toCamelCase(String aKey)
TextAccessor.getText()
to camel-case
("camelCase").aKey
- The key to be converted.String toPascalCase(String aKey)
TextAccessor.getText()
to pascal-case
("PascalCase").aKey
- The key to be converted.String toSnakeCase(String aKey)
TextAccessor.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 CaseAccessor.CaseMutator.setCase(Case)
and
CaseAccessor.getCase()
).aKey
- The key to be converted.String toKebabCase(String aKey)
TextAccessor.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 CaseAccessor.CaseMutator.setCase(Case)
and
CaseAccessor.getCase()
).aKey
- The key to be converted.default CaseStyleBuilder withCase(Case aCase)
withCase
in interface CaseAccessor.CaseBuilder<CaseStyleBuilder>
aCase
- the a caseCopyright © 2017. All rights reserved.