Package kr.toxicity.model.api.pack
Record Class PackPath
java.lang.Object
java.lang.Record
kr.toxicity.model.api.pack.PackPath
- Record Components:
path- the string representation of the path
- All Implemented Interfaces:
Comparable<PackPath>
Represents a path within a resource pack.
This record encapsulates a string path and provides utility methods for resolving sub-paths.
It implements Comparable for sorting purposes.
- Since:
- 1.15.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Stringpath()Returns the value of thepathrecord component.@NotNull PackPathResolves a sub-path relative to this path.@NotNull StringtoString()Returns a string representation of this record class.
-
Field Details
-
DELIMITER
The delimiter used for path separation.- Since:
- 1.15.2
- See Also:
-
EMPTY
An empty pack path.- Since:
- 1.15.2
-
-
Constructor Details
-
PackPath
Creates an instance of aPackPathrecord class.- Parameters:
path- the value for thepathrecord component
-
-
Method Details
-
resolve
Resolves a sub-path relative to this path.- Parameters:
subPaths- the sub-path components to resolve- Returns:
- the resolved pack path
- Since:
- 1.15.2
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
compareTo
- Specified by:
compareToin interfaceComparable<PackPath>
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-