Class ImmutableExpressionResult.Builder

java.lang.Object
io.resys.hdes.client.api.programs.ImmutableExpressionResult.Builder
Enclosing class:
ImmutableExpressionResult

@NotThreadSafe public static final class ImmutableExpressionResult.Builder extends Object
Builds instances of type ImmutableExpressionResult. 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 ImmutableExpressionResult.Builder from(ExpressionProgram.ExpressionResult instance)
      Fill a builder with attribute values from the provided ExpressionResult instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • type

      @CanIgnoreReturnValue public final ImmutableExpressionResult.Builder type(TypeDef.ValueType type)
      Initializes the value for the type attribute.
      Parameters:
      type - The value for type
      Returns:
      this builder for use in a chained invocation
    • addConstants

      @CanIgnoreReturnValue public final ImmutableExpressionResult.Builder addConstants(String element)
      Adds one element to constants list.
      Parameters:
      element - A constants element
      Returns:
      this builder for use in a chained invocation
    • addConstants

      @CanIgnoreReturnValue public final ImmutableExpressionResult.Builder addConstants(String... elements)
      Adds elements to constants list.
      Parameters:
      elements - An array of constants elements
      Returns:
      this builder for use in a chained invocation
    • constants

      @CanIgnoreReturnValue public final ImmutableExpressionResult.Builder constants(Iterable<String> elements)
      Sets or replaces all elements for constants list.
      Parameters:
      elements - An iterable of constants elements
      Returns:
      this builder for use in a chained invocation
    • addAllConstants

      @CanIgnoreReturnValue public final ImmutableExpressionResult.Builder addAllConstants(Iterable<String> elements)
      Adds elements to constants list.
      Parameters:
      elements - An iterable of constants elements
      Returns:
      this builder for use in a chained invocation
    • value

      @CanIgnoreReturnValue public final ImmutableExpressionResult.Builder value(@Nullable Object value)
      Initializes the value for the value attribute.
      Parameters:
      value - The value for value (can be null)
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableExpressionResult build()
      Returns:
      An immutable instance of ExpressionResult
      Throws:
      IllegalStateException - if any required attributes are missing