Class ImmutableType.Struct.Builder

java.lang.Object
io.substrait.type.ImmutableType.Struct.Builder
Enclosing class:
ImmutableType.Struct

public static final class ImmutableType.Struct.Builder extends Object
Builds instances of type Struct. 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

      public final ImmutableType.Struct.Builder from(NullableType instance)
      Fill a builder with attribute values from the provided io.substrait.function.NullableType instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      public final ImmutableType.Struct.Builder from(Type instance)
      Fill a builder with attribute values from the provided io.substrait.type.Type instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      public final ImmutableType.Struct.Builder from(Type.Struct instance)
      Fill a builder with attribute values from the provided io.substrait.type.Type.Struct instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • nullable

      public final ImmutableType.Struct.Builder nullable(boolean nullable)
      Initializes the value for the nullable attribute.
      Parameters:
      nullable - The value for nullable
      Returns:
      this builder for use in a chained invocation
    • addFields

      public final ImmutableType.Struct.Builder addFields(Type element)
      Adds one element to fields list.
      Parameters:
      element - A fields element
      Returns:
      this builder for use in a chained invocation
    • addFields

      public final ImmutableType.Struct.Builder addFields(Type... elements)
      Adds elements to fields list.
      Parameters:
      elements - An array of fields elements
      Returns:
      this builder for use in a chained invocation
    • fields

      public final ImmutableType.Struct.Builder fields(Iterable<? extends Type> elements)
      Sets or replaces all elements for fields list.
      Parameters:
      elements - An iterable of fields elements
      Returns:
      this builder for use in a chained invocation
    • addAllFields

      public final ImmutableType.Struct.Builder addAllFields(Iterable<? extends Type> elements)
      Adds elements to fields list.
      Parameters:
      elements - An iterable of fields elements
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableType.Struct build()
      Builds a new Struct.
      Returns:
      An immutable instance of Struct
      Throws:
      IllegalStateException - if any required attributes are missing