Package com.io7m.jspatial.api.octtrees
Class OctTreeRaycastResultI.Builder<T>
- java.lang.Object
-
- com.io7m.jspatial.api.octtrees.OctTreeRaycastResultI.Builder<T>
-
- Enclosing class:
- OctTreeRaycastResultI<T>
public static final class OctTreeRaycastResultI.Builder<T> extends java.lang.ObjectBuilds instances of typeOctTreeRaycastResultI. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OctTreeRaycastResultI<T>build()Builds a newOctTreeRaycastResultI.OctTreeRaycastResultI.Builder<T>from(OctTreeRaycastResultIType<T> instance)Fill a builder with attribute values from the providedOctTreeRaycastResultITypeinstance.OctTreeRaycastResultI.Builder<T>setDistance(double distance)Initializes the value for thedistanceattribute.OctTreeRaycastResultI.Builder<T>setItem(T item)Initializes the value for theitemattribute.OctTreeRaycastResultI.Builder<T>setVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeI volume)Initializes the value for thevolumeattribute.
-
-
-
Method Detail
-
from
public final OctTreeRaycastResultI.Builder<T> from(OctTreeRaycastResultIType<T> instance)
Fill a builder with attribute values from the providedOctTreeRaycastResultITypeinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setDistance
public final OctTreeRaycastResultI.Builder<T> setDistance(double distance)
Initializes the value for thedistanceattribute.- Parameters:
distance- The value for distance- Returns:
thisbuilder for use in a chained invocation
-
setVolume
public final OctTreeRaycastResultI.Builder<T> setVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeI volume)
Initializes the value for thevolumeattribute.- Parameters:
volume- The value for volume- Returns:
thisbuilder for use in a chained invocation
-
setItem
public final OctTreeRaycastResultI.Builder<T> setItem(T item)
Initializes the value for theitemattribute.- Parameters:
item- The value for item- Returns:
thisbuilder for use in a chained invocation
-
build
public OctTreeRaycastResultI<T> build()
Builds a newOctTreeRaycastResultI.- Returns:
- An immutable instance of OctTreeRaycastResultI
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-