Class QuadTreeRaycastResultI.Builder<T>

  • Enclosing class:
    QuadTreeRaycastResultI<T>

    public static final class QuadTreeRaycastResultI.Builder<T>
    extends java.lang.Object
    Builds instances of type QuadTreeRaycastResultI. Initialize attributes and then invoke the build() 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 Detail

      • from

        public final QuadTreeRaycastResultI.Builder<T> from​(QuadTreeRaycastResultIType<T> instance)
        Fill a builder with attribute values from the provided QuadTreeRaycastResultIType 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 QuadTreeRaycastResultI.Builder<T> setDistance​(double distance)
        Initializes the value for the distance attribute.
        Parameters:
        distance - The value for distance
        Returns:
        this builder for use in a chained invocation
      • setArea

        public final QuadTreeRaycastResultI.Builder<T> setArea​(com.io7m.jregions.core.unparameterized.areas.AreaI area)
        Initializes the value for the area attribute.
        Parameters:
        area - The value for area
        Returns:
        this builder for use in a chained invocation
      • setItem

        public final QuadTreeRaycastResultI.Builder<T> setItem​(T item)
        Initializes the value for the item attribute.
        Parameters:
        item - The value for item
        Returns:
        this builder for use in a chained invocation
      • build

        public QuadTreeRaycastResultI<T> build()
        Returns:
        An immutable instance of QuadTreeRaycastResultI
        Throws:
        java.lang.IllegalStateException - if any required attributes are missing