Class WXM1Paths.Builder

java.lang.Object
com.io7m.waxmill.xml.config.v1.WXM1Paths.Builder
Enclosing class:
WXM1Paths

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

      public final WXM1Paths.Builder addPaths​(WXM1Path element)
      Adds one element to paths list.
      Parameters:
      element - A paths element
      Returns:
      this builder for use in a chained invocation
    • addPaths

      public final WXM1Paths.Builder addPaths​(WXM1Path... elements)
      Adds elements to paths list.
      Parameters:
      elements - An array of paths elements
      Returns:
      this builder for use in a chained invocation
    • setPaths

      public final WXM1Paths.Builder setPaths​(java.lang.Iterable<? extends WXM1Path> elements)
      Sets or replaces all elements for paths list.
      Parameters:
      elements - An iterable of paths elements
      Returns:
      this builder for use in a chained invocation
    • addAllPaths

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

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