public abstract class Case extends Object
Modifier and Type | Field and Description |
---|---|
static Case |
CAMEL
Camel case, for instance FooBar.
|
static Case |
KEBAB
Kebab case, for instance foo-bar.
|
static Case |
LOWER_CAMEL
Camel case starting with a lower case, for instance fooBar.
|
static Case |
QUALIFIED
Java full qualified case, for instance foo.bar
|
static Case |
SNAKE
Snake case, for instance foo_bar.
|
Constructor and Description |
---|
Case() |
Modifier and Type | Method and Description |
---|---|
String |
format(Iterable<String> atoms) |
String |
name() |
List<String> |
parse(String name)
Parse the
name argument and returns a list of the name atoms. |
protected static List<String> |
split(String s,
String regex) |
String |
to(Case dest,
String name)
Convert a name from this case to the dest case
|
static Map<String,Case> |
vars()
Useful for testing the method kind, allows to do method.kind == METHOD_HANDLER instead of method.kind.name() == "HANDLER"
|
public static final Case LOWER_CAMEL
public static final Case CAMEL
public static final Case QUALIFIED
public static final Case KEBAB
public static final Case SNAKE
public String name()
public List<String> parse(String name)
name
argument and returns a list of the name atoms.name
- the name to parseIllegalArgumentException
- if the name has a syntax errorpublic String to(Case dest, String name)
dest
- the destination casename
- the name to convertCopyright © 2017. All rights reserved.