public class RouteFactory extends Object
| Constructor and Description |
|---|
RouteFactory()
Creates a factory with the default separator defined by
GeneralSettings.DEFAULT_ROUTE_SEPARATOR. |
RouteFactory(GeneralSettings generalSettings)
Creates a factory with the given setting's
separator. |
RouteFactory(char separator)
Creates a factory with the given separator.
|
| Modifier and Type | Method and Description |
|---|---|
Route |
create(String route)
Constructs a route by splitting the given string route by the
factory's separator. |
String |
getEscapedSeparator()
Returns the escaped
separator. |
char |
getSeparator()
Returns the separator character.
|
public RouteFactory(@NotNull
GeneralSettings generalSettings)
separator.generalSettings - provider of the separator to usepublic RouteFactory(char separator)
separator - separator to usepublic RouteFactory()
GeneralSettings.DEFAULT_ROUTE_SEPARATOR.@NotNull public Route create(String route)
factory's separator.
For example, giving string route "a.b" will return the equivalent route containing 2 keys:
["a", "b"].
Please note that string routes can also be used as Route objects, therefore you should not introduce
additional overhead by converting them using methods provided by this class, unless necessarily needed.
route - the string route to splitimplementation informationpublic char getSeparator()
Copyright © 2024. All rights reserved.