Class ResultPath
java.lang.Object
com.amalgamasimulation.studies.result.ResultPath
A class representing a path composed of string elements joined by a
delimiter. The path is used to obtain the ResultElement.
The delimiter used to join elements is defined by DELIMITER. Path
elements cannot contain the delimiter string.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionResultPath(List<String> elements) Constructs a new ResultPath from the given elements. -
Method Summary
Modifier and TypeMethodDescriptionAppends an element to this path and returns a new ResultPath.booleancontains(ResultPath otherPath) Checks if this path contains another path as a substring.elements()Returns an unmodifiable view of the path elements.static ResultPathempty()Returns an empty ResultPath.booleaninthashCode()booleanisEmpty()Checks if this path is empty (has no elements).localizedFullPath(Function<ResultPath, String> localizedTitleSupplier) static ResultPathCreates a new ResultPath from the given elements.toString()
-
Field Details
-
DELIMITER
- See Also:
-
-
Constructor Details
-
ResultPath
Constructs a new ResultPath from the given elements.- Parameters:
elements- the list of path elements- Throws:
IllegalArgumentException- if any element contains the delimiter string
-
-
Method Details
-
of
Creates a new ResultPath from the given elements. Each string argument may contain multiple elements separated by the delimiter.- Parameters:
elements- the path elements (may be delimited strings)- Returns:
- a new ResultPath containing all elements
-
empty
Returns an empty ResultPath.- Returns:
- an empty ResultPath
-
append
Appends an element to this path and returns a new ResultPath.- Parameters:
element- the element to append- Returns:
- a new ResultPath with the element appended
-
toString
-
equals
-
hashCode
public int hashCode() -
contains
Checks if this path contains another path as a substring.- Parameters:
otherPath- the path to check for containment- Returns:
- true if this path's string representation contains the other path's string representation
-
elements
Returns an unmodifiable view of the path elements.- Returns:
- the list of path elements
-
isEmpty
public boolean isEmpty()Checks if this path is empty (has no elements).- Returns:
- true if this path has no elements, false otherwise
-
localizedFullPath
-