Package com.io7m.jspatial.api.octtrees
Class OctTreeRaycastResultD.Builder<T>
- java.lang.Object
-
- com.io7m.jspatial.api.octtrees.OctTreeRaycastResultD.Builder<T>
-
- Enclosing class:
- OctTreeRaycastResultD<T>
public static final class OctTreeRaycastResultD.Builder<T> extends java.lang.Object
Builds instances of typeOctTreeRaycastResultD
. Initialize attributes and then invoke thebuild()
method to create an immutable instance.Builder
is 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 OctTreeRaycastResultD<T>
build()
Builds a newOctTreeRaycastResultD
.OctTreeRaycastResultD.Builder<T>
from(OctTreeRaycastResultDType<T> instance)
Fill a builder with attribute values from the providedOctTreeRaycastResultDType
instance.OctTreeRaycastResultD.Builder<T>
setDistance(double distance)
Initializes the value for thedistance
attribute.OctTreeRaycastResultD.Builder<T>
setItem(T item)
Initializes the value for theitem
attribute.OctTreeRaycastResultD.Builder<T>
setVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeD volume)
Initializes the value for thevolume
attribute.
-
-
-
Method Detail
-
from
public final OctTreeRaycastResultD.Builder<T> from(OctTreeRaycastResultDType<T> instance)
Fill a builder with attribute values from the providedOctTreeRaycastResultDType
instance. 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:
this
builder for use in a chained invocation
-
setDistance
public final OctTreeRaycastResultD.Builder<T> setDistance(double distance)
Initializes the value for thedistance
attribute.- Parameters:
distance
- The value for distance- Returns:
this
builder for use in a chained invocation
-
setVolume
public final OctTreeRaycastResultD.Builder<T> setVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeD volume)
Initializes the value for thevolume
attribute.- Parameters:
volume
- The value for volume- Returns:
this
builder for use in a chained invocation
-
setItem
public final OctTreeRaycastResultD.Builder<T> setItem(T item)
Initializes the value for theitem
attribute.- Parameters:
item
- The value for item- Returns:
this
builder for use in a chained invocation
-
build
public OctTreeRaycastResultD<T> build()
Builds a newOctTreeRaycastResultD
.- Returns:
- An immutable instance of OctTreeRaycastResultD
- Throws:
java.lang.IllegalStateException
- if any required attributes are missing
-
-