Package me.hsgamer.hscore.config
Class PathString
java.lang.Object
me.hsgamer.hscore.config.PathString
The path string to use in
Config-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default separatorstatic final PathStringThe root path -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a new path string by appending the path to the current path stringappend(PathString pathString) Create a new path string by appending the path string to the current path stringbooleanGet the last pathString[]getPath()Get the pathObject[]Get the path as object arrayinthashCode()booleanisRoot()Check if the path is empty.static StringtoPath(String separator, PathString pathString) Join the path with the separatorstatic StringtoPath(PathString pathString) Join the path with the default separatortoPathMap(String separator, Map<PathString, Object> map) Join the path with the separatortoPathMap(Map<PathString, Object> map) Join the path with the default separatorstatic PathStringtoPathString(String path) Split the path with the default separatorstatic PathStringtoPathString(String separator, String path) Split the path with the separatorstatic Map<PathString,Object> toPathStringMap(String separator, Map<String, Object> map) Split the path with the separatorstatic Map<PathString,Object> toPathStringMap(Map<String, Object> map) Split the path with the default separator
-
Field Details
-
ROOT
The root path -
DEFAULT_SEPARATOR
The default separator- See Also:
-
-
Constructor Details
-
PathString
Create a new path string- Parameters:
path- the path
-
-
Method Details
-
toPath
Join the path with the separator- Parameters:
separator- the separatorpathString- the path string- Returns:
- the joined path
-
toPathString
Split the path with the separator- Parameters:
separator- the separatorpath- the path- Returns:
- the path string
-
toPathMap
Join the path with the separator- Parameters:
separator- the separatormap- the map containing the path string- Returns:
- the map containing the joined path
-
toPathStringMap
Split the path with the separator- Parameters:
separator- the separatormap- the map containing the path- Returns:
- the map containing the path string
-
toPath
Join the path with the default separator- Parameters:
pathString- the path string- Returns:
- the joined path
-
toPathString
Split the path with the default separator- Parameters:
path- the path- Returns:
- the path string
-
toPathMap
Join the path with the default separator- Parameters:
map- the map containing the path string- Returns:
- the map containing the joined path
-
toPathStringMap
Split the path with the default separator- Parameters:
map- the map containing the path- Returns:
- the map containing the path string
-
getPath
Get the path- Returns:
- the path
-
getPathAsObject
Get the path as object array- Returns:
- the path as object array
-
isRoot
public boolean isRoot()Check if the path is empty. It means that the path isROOT- Returns:
- true if the path is empty
-
getLastPath
Get the last path- Returns:
- the last path
-
append
Create a new path string by appending the path string to the current path string- Parameters:
pathString- the path string to append- Returns:
- the new path string
-
append
Create a new path string by appending the path to the current path string- Parameters:
path- the path to append- Returns:
- the new path string
-
equals
-
hashCode
public int hashCode()
-