Package com.io7m.waxmill.xml.config.v1
Class WXM1Paths
java.lang.Object
com.io7m.waxmill.xml.config.v1.WXM1Paths
- All Implemented Interfaces:
WXM1PathsType
public final class WXM1Paths extends java.lang.Object implements WXM1PathsType
Immutable implementation of
WXM1PathsType.
Use the builder to create immutable instances:
WXM1Paths.builder().
Use the static factory method to create immutable instances:
WXM1Paths.of().
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXM1Paths.BuilderBuilds instances of typeWXM1Paths. -
Method Summary
Modifier and Type Method Description static WXM1Paths.Builderbuilder()Creates a builder forWXM1Paths.static WXM1PathscopyOf(WXM1PathsType instance)Creates an immutable copy of aWXM1PathsTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXM1Pathsthat have equal attribute values.inthashCode()Computes a hash code from attributes:paths,pathMap.static WXM1Pathsof(java.lang.Iterable<? extends WXM1Path> paths)Construct a new immutableWXM1Pathsinstance.static WXM1Pathsof(java.util.List<WXM1Path> paths)Construct a new immutableWXM1Pathsinstance.java.util.Map<java.lang.String,WXM1Path>pathMap()java.util.List<WXM1Path>paths()java.lang.StringtoString()Prints the immutable valueWXM1Pathswith attribute values.WXM1PathswithPaths(WXM1Path... elements)Copy the current immutable object with elements that replace the content ofpaths.WXM1PathswithPaths(java.lang.Iterable<? extends WXM1Path> elements)Copy the current immutable object with elements that replace the content ofpaths.
-
Method Details
-
paths
- Specified by:
pathsin interfaceWXM1PathsType- Returns:
- The value of the
pathsattribute
-
pathMap
- Specified by:
pathMapin interfaceWXM1PathsType- Returns:
- The computed-at-construction value of the
pathMapattribute
-
withPaths
Copy the current immutable object with elements that replace the content ofpaths.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withPaths
Copy the current immutable object with elements that replace the content ofpaths. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of paths elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXM1Pathsthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:paths,pathMap.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXM1Pathswith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutableWXM1Pathsinstance.- Parameters:
paths- The value for thepathsattribute- Returns:
- An immutable WXM1Paths instance
-
of
Construct a new immutableWXM1Pathsinstance.- Parameters:
paths- The value for thepathsattribute- Returns:
- An immutable WXM1Paths instance
-
copyOf
Creates an immutable copy of aWXM1PathsTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable WXM1Paths instance
-
builder
Creates a builder forWXM1Paths.WXM1Paths.builder() .addPaths|addAllPaths(WXM1Path) //pathselements .build();- Returns:
- A new WXM1Paths builder
-