Class MLongDescription.Builder

java.lang.Object
com.io7m.montarre.api.MLongDescription.Builder
Enclosing class:
MLongDescription

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

      public final MLongDescription.Builder setLanguage(MLanguageCode language)
      Initializes the value for the language attribute.

      If not set, this attribute will have a default value as returned by the initializer of language.

      Parameters:
      language - The value for language
      Returns:
      this builder for use in a chained invocation
    • addDescriptions

      public final MLongDescription.Builder addDescriptions(MParagraph element)
      Adds one element to descriptions list.
      Parameters:
      element - A descriptions element
      Returns:
      this builder for use in a chained invocation
    • addDescriptions

      public final MLongDescription.Builder addDescriptions(MParagraph... elements)
      Adds elements to descriptions list.
      Parameters:
      elements - An array of descriptions elements
      Returns:
      this builder for use in a chained invocation
    • setDescriptions

      public final MLongDescription.Builder setDescriptions(Iterable<? extends MParagraph> elements)
      Sets or replaces all elements for descriptions list.
      Parameters:
      elements - An iterable of descriptions elements
      Returns:
      this builder for use in a chained invocation
    • addAllDescriptions

      public final MLongDescription.Builder addAllDescriptions(Iterable<? extends MParagraph> elements)
      Adds elements to descriptions list.
      Parameters:
      elements - An iterable of descriptions elements
      Returns:
      this builder for use in a chained invocation
    • addFeatures

      public final MLongDescription.Builder addFeatures(MFeature element)
      Adds one element to features list.
      Parameters:
      element - A features element
      Returns:
      this builder for use in a chained invocation
    • addFeatures

      public final MLongDescription.Builder addFeatures(MFeature... elements)
      Adds elements to features list.
      Parameters:
      elements - An array of features elements
      Returns:
      this builder for use in a chained invocation
    • setFeatures

      public final MLongDescription.Builder setFeatures(Iterable<? extends MFeature> elements)
      Sets or replaces all elements for features list.
      Parameters:
      elements - An iterable of features elements
      Returns:
      this builder for use in a chained invocation
    • addAllFeatures

      public final MLongDescription.Builder addAllFeatures(Iterable<? extends MFeature> elements)
      Adds elements to features list.
      Parameters:
      elements - An iterable of features elements
      Returns:
      this builder for use in a chained invocation
    • build

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