Package me.hsgamer.hscore.config
Class PathString
java.lang.Object
me.hsgamer.hscore.config.PathString
- All Implemented Interfaces:
Comparable<PathString>
The path string to use in
Config
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The default separatorstatic final PathString
The root path -
Constructor Summary
-
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 stringint
compareTo
(@NotNull PathString o) boolean
Get the last pathString[]
getPath()
Get the pathObject[]
Get the path as object arrayint
hashCode()
boolean
isRoot()
Check if the path is empty.static String
toPath
(String separator, PathString pathString) Join the path with the separatorstatic String
toPath
(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 PathString
toPathString
(String path) Split the path with the default separatorstatic PathString
toPathString
(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() -
compareTo
- Specified by:
compareTo
in interfaceComparable<PathString>
-