Class WXM1OpenOptions.Builder

java.lang.Object
com.io7m.waxmill.xml.vm.v1.WXM1OpenOptions.Builder
Enclosing class:
WXM1OpenOptions

public static final class WXM1OpenOptions.Builder
extends java.lang.Object
Builds instances of type WXM1OpenOptions. 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 WXM1OpenOptions.Builder from​(WXM1OpenOptionsType instance)
      Fill a builder with attribute values from the provided WXM1OpenOptionsType 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
    • addOpenOptions

      public final WXM1OpenOptions.Builder addOpenOptions​(WXMOpenOption element)
      Adds one element to openOptions list.
      Parameters:
      element - A openOptions element
      Returns:
      this builder for use in a chained invocation
    • addOpenOptions

      public final WXM1OpenOptions.Builder addOpenOptions​(WXMOpenOption... elements)
      Adds elements to openOptions list.
      Parameters:
      elements - An array of openOptions elements
      Returns:
      this builder for use in a chained invocation
    • setOpenOptions

      public final WXM1OpenOptions.Builder setOpenOptions​(java.lang.Iterable<? extends WXMOpenOption> elements)
      Sets or replaces all elements for openOptions list.
      Parameters:
      elements - An iterable of openOptions elements
      Returns:
      this builder for use in a chained invocation
    • addAllOpenOptions

      public final WXM1OpenOptions.Builder addAllOpenOptions​(java.lang.Iterable<? extends WXMOpenOption> elements)
      Adds elements to openOptions list.
      Parameters:
      elements - An iterable of openOptions elements
      Returns:
      this builder for use in a chained invocation
    • build

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