- java.lang.Object
-
- io.vertx.codegen.format.Case
-
- Direct Known Subclasses:
CamelCase,KebabCase,LowerCamelCase,QualifiedCase,SnakeCase
public abstract class Case extends Object
- Author:
- Julien Viet
-
-
Constructor Summary
Constructors Constructor Description Case()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat(Iterable<String> atoms)Stringname()List<String>parse(String name)Parse thenameargument and returns a list of the name atoms.protected static List<String>split(String s, String regex)Stringto(Case dest, String name)Convert a name from this case to the dest casestatic Map<String,Case>vars()Useful for formatting or parsing string, eg:CASE_CAMEL.format(CASE_SNAKE.parse("foo_bar")),it will return fooBar
-
-
-
Method Detail
-
name
public String name()
-
parse
public List<String> parse(String name)
Parse thenameargument and returns a list of the name atoms.- Parameters:
name- the name to parse- Returns:
- the name atoms
- Throws:
IllegalArgumentException- if the name has a syntax error
-
to
public String to(Case dest, String name)
Convert a name from this case to the dest case- Parameters:
dest- the destination casename- the name to convert- Returns:
- the converted name
-
-