Class ImmutableEmpiricalFunction.Builder

java.lang.Object
io.github.ai4ci.util.ImmutableEmpiricalFunction.Builder
Enclosing class:
ImmutableEmpiricalFunction

@NotThreadSafe public static final class ImmutableEmpiricalFunction.Builder extends Object
Builds instances of type ImmutableEmpiricalFunction. 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 Details

    • from

      @CanIgnoreReturnValue public final ImmutableEmpiricalFunction.Builder from(EmpiricalFunction instance)
      Fill a builder with attribute values from the provided EmpiricalFunction 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
    • setX

      @CanIgnoreReturnValue public final ImmutableEmpiricalFunction.Builder setX(double... x)
      Initializes the value for the x attribute.
      Parameters:
      x - The elements for x
      Returns:
      this builder for use in a chained invocation
    • setY

      @CanIgnoreReturnValue public final ImmutableEmpiricalFunction.Builder setY(double... y)
      Initializes the value for the y attribute.
      Parameters:
      y - The elements for y
      Returns:
      this builder for use in a chained invocation
    • setLink

      @CanIgnoreReturnValue public final ImmutableEmpiricalFunction.Builder setLink(EmpiricalFunction.Link link)
      Initializes the value for the link attribute.

      If not set, this attribute will have a default value as returned by the initializer of link.

      Parameters:
      link - The value for link
      Returns:
      this builder for use in a chained invocation
    • build

      Returns:
      An immutable instance of EmpiricalFunction
      Throws:
      IllegalStateException - if any required attributes are missing