public class JavaName extends Object
Modifier and Type | Method and Description |
---|---|
void |
addFirst(String segment)
Inserts a name segment into beginning of this name.
|
void |
addLast(String segment)
Inserts a name segment into ending of this name.
|
List<String> |
getSegments()
Returns name segments as lower case characters.
|
static JavaName |
of(String nameString)
Returns a Java name represented in the specified string.
|
void |
removeFirst()
Removes the first name segment in this name.
|
void |
removeLast()
Removes the last name segment in this name.
|
String |
toConstantName()
Returns this name in form of constant names (
UPPER_CASE ). |
String |
toMemberName()
Returns this name in form of member names (
camelCase ). |
String |
toSnakeName()
Returns this name in form of constant names (
snake_case ). |
String |
toTypeName()
Returns this name in form of type names (
CamelCase ). |
public static JavaName of(String nameString)
nameString
- a string which represents a Java nameIllegalArgumentException
- if some parameters were null
public List<String> getSegments()
public String toTypeName()
CamelCase
).public String toMemberName()
camelCase
).public String toConstantName()
UPPER_CASE
).public String toSnakeName()
snake_case
).public void addFirst(String segment)
segment
- the name segmentIllegalArgumentException
- if the name segment is not validpublic void removeFirst()
IllegalStateException
- if this name is emptypublic void addLast(String segment)
segment
- the name segmentIllegalArgumentException
- if the name segment is not validpublic void removeLast()
IllegalStateException
- if this name is emptyCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.