Class ImmutableNamedStruct.Builder

java.lang.Object
io.substrait.type.ImmutableNamedStruct.Builder
Enclosing class:
ImmutableNamedStruct

public static final class ImmutableNamedStruct.Builder extends Object
Builds instances of type ImmutableNamedStruct. 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 ImmutableNamedStruct.Builder from(NamedStruct instance)
      Fill a builder with attribute values from the provided NamedStruct 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
    • struct

      public final ImmutableNamedStruct.Builder struct(Type.Struct struct)
      Initializes the value for the struct attribute.
      Parameters:
      struct - The value for struct
      Returns:
      this builder for use in a chained invocation
    • addNames

      public final ImmutableNamedStruct.Builder addNames(String element)
      Adds one element to names list.
      Parameters:
      element - A names element
      Returns:
      this builder for use in a chained invocation
    • addNames

      public final ImmutableNamedStruct.Builder addNames(String... elements)
      Adds elements to names list.
      Parameters:
      elements - An array of names elements
      Returns:
      this builder for use in a chained invocation
    • names

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

      public final ImmutableNamedStruct.Builder addAllNames(Iterable<String> elements)
      Adds elements to names list.
      Parameters:
      elements - An iterable of names elements
      Returns:
      this builder for use in a chained invocation
    • build

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