Package com.io7m.jspatial.api.quadtrees
Class QuadTreeRaycastResultD.Builder<T>
- java.lang.Object
-
- com.io7m.jspatial.api.quadtrees.QuadTreeRaycastResultD.Builder<T>
-
- Enclosing class:
- QuadTreeRaycastResultD<T>
public static final class QuadTreeRaycastResultD.Builder<T> extends java.lang.ObjectBuilds instances of typeQuadTreeRaycastResultD. 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 QuadTreeRaycastResultD<T>build()Builds a newQuadTreeRaycastResultD.QuadTreeRaycastResultD.Builder<T>from(QuadTreeRaycastResultDType<T> instance)Fill a builder with attribute values from the providedQuadTreeRaycastResultDTypeinstance.QuadTreeRaycastResultD.Builder<T>setArea(com.io7m.jregions.core.unparameterized.areas.AreaD area)Initializes the value for theareaattribute.QuadTreeRaycastResultD.Builder<T>setDistance(double distance)Initializes the value for thedistanceattribute.QuadTreeRaycastResultD.Builder<T>setItem(T item)Initializes the value for theitemattribute.
-
-
-
Method Detail
-
from
public final QuadTreeRaycastResultD.Builder<T> from(QuadTreeRaycastResultDType<T> instance)
Fill a builder with attribute values from the providedQuadTreeRaycastResultDTypeinstance. 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 QuadTreeRaycastResultD.Builder<T> setDistance(double distance)
Initializes the value for thedistanceattribute.- Parameters:
distance- The value for distance- Returns:
thisbuilder for use in a chained invocation
-
setArea
public final QuadTreeRaycastResultD.Builder<T> setArea(com.io7m.jregions.core.unparameterized.areas.AreaD area)
Initializes the value for theareaattribute.- Parameters:
area- The value for area- Returns:
thisbuilder for use in a chained invocation
-
setItem
public final QuadTreeRaycastResultD.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 QuadTreeRaycastResultD<T> build()
Builds a newQuadTreeRaycastResultD.- Returns:
- An immutable instance of QuadTreeRaycastResultD
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-