Class Meta.Builder

  • Enclosing class:
    Meta

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

    • Constructor Detail

      • Builder

        public Builder()
        Creates a builder for Meta instances.
         new Meta.Builder()
            .definition(DefinitionPropertyValue | null) // nullable definition
            .addComment|addAllComments(String) // comments elements
            .addSubset|addAllSubsets(String) // subsets elements
            .addSynonym|addAllSynonyms(SynonymPropertyValue) // synonyms elements
            .addXref|addAllXrefs(XrefPropertyValue) // xrefs elements
            .addXrefsValue|addAllXrefsValues(String) // xrefsValues elements
            .addBasicPropertyValue|addAllBasicPropertyValues(BasicPropertyValue) // basicPropertyValues elements
            .version(String) // optional version
            .deprecated(boolean) // optional deprecated
            .build();
         
    • Method Detail

      • from

        @CanIgnoreReturnValue
        public final Meta.Builder from​(AbstractMeta instance)
        Fill a builder with attribute values from the provided AbstractMeta 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
      • definition

        @CanIgnoreReturnValue
        public final Meta.Builder definition​(@Nullable
                                             DefinitionPropertyValue definition)
        Initializes the value for the definition attribute.
        Parameters:
        definition - The value for definition (can be null)
        Returns:
        this builder for use in a chained invocation
      • addComment

        @CanIgnoreReturnValue
        public final Meta.Builder addComment​(String element)
        Adds one element to comments list.
        Parameters:
        element - A comments element
        Returns:
        this builder for use in a chained invocation
      • addComments

        @CanIgnoreReturnValue
        public final Meta.Builder addComments​(String... elements)
        Adds elements to comments list.
        Parameters:
        elements - An array of comments elements
        Returns:
        this builder for use in a chained invocation
      • comments

        @CanIgnoreReturnValue
        public final Meta.Builder comments​(Iterable<String> elements)
        Sets or replaces all elements for comments list.
        Parameters:
        elements - An iterable of comments elements
        Returns:
        this builder for use in a chained invocation
      • addAllComments

        @CanIgnoreReturnValue
        public final Meta.Builder addAllComments​(Iterable<String> elements)
        Adds elements to comments list.
        Parameters:
        elements - An iterable of comments elements
        Returns:
        this builder for use in a chained invocation
      • addSubset

        @CanIgnoreReturnValue
        public final Meta.Builder addSubset​(String element)
        Adds one element to subsets list.
        Parameters:
        element - A subsets element
        Returns:
        this builder for use in a chained invocation
      • addSubsets

        @CanIgnoreReturnValue
        public final Meta.Builder addSubsets​(String... elements)
        Adds elements to subsets list.
        Parameters:
        elements - An array of subsets elements
        Returns:
        this builder for use in a chained invocation
      • subsets

        @CanIgnoreReturnValue
        public final Meta.Builder subsets​(Iterable<String> elements)
        Sets or replaces all elements for subsets list.
        Parameters:
        elements - An iterable of subsets elements
        Returns:
        this builder for use in a chained invocation
      • addAllSubsets

        @CanIgnoreReturnValue
        public final Meta.Builder addAllSubsets​(Iterable<String> elements)
        Adds elements to subsets list.
        Parameters:
        elements - An iterable of subsets elements
        Returns:
        this builder for use in a chained invocation
      • addSynonym

        @CanIgnoreReturnValue
        public final Meta.Builder addSynonym​(SynonymPropertyValue element)
        Adds one element to synonyms list.
        Parameters:
        element - A synonyms element
        Returns:
        this builder for use in a chained invocation
      • addSynonyms

        @CanIgnoreReturnValue
        public final Meta.Builder addSynonyms​(SynonymPropertyValue... elements)
        Adds elements to synonyms list.
        Parameters:
        elements - An array of synonyms elements
        Returns:
        this builder for use in a chained invocation
      • synonyms

        @CanIgnoreReturnValue
        public final Meta.Builder synonyms​(Iterable<? extends SynonymPropertyValue> elements)
        Sets or replaces all elements for synonyms list.
        Parameters:
        elements - An iterable of synonyms elements
        Returns:
        this builder for use in a chained invocation
      • addAllSynonyms

        @CanIgnoreReturnValue
        public final Meta.Builder addAllSynonyms​(Iterable<? extends SynonymPropertyValue> elements)
        Adds elements to synonyms list.
        Parameters:
        elements - An iterable of synonyms elements
        Returns:
        this builder for use in a chained invocation
      • addXref

        @CanIgnoreReturnValue
        public final Meta.Builder addXref​(XrefPropertyValue element)
        Adds one element to xrefs list.
        Parameters:
        element - A xrefs element
        Returns:
        this builder for use in a chained invocation
      • addXrefs

        @CanIgnoreReturnValue
        public final Meta.Builder addXrefs​(XrefPropertyValue... elements)
        Adds elements to xrefs list.
        Parameters:
        elements - An array of xrefs elements
        Returns:
        this builder for use in a chained invocation
      • xrefs

        @CanIgnoreReturnValue
        public final Meta.Builder xrefs​(Iterable<? extends XrefPropertyValue> elements)
        Sets or replaces all elements for xrefs list.
        Parameters:
        elements - An iterable of xrefs elements
        Returns:
        this builder for use in a chained invocation
      • addAllXrefs

        @CanIgnoreReturnValue
        public final Meta.Builder addAllXrefs​(Iterable<? extends XrefPropertyValue> elements)
        Adds elements to xrefs list.
        Parameters:
        elements - An iterable of xrefs elements
        Returns:
        this builder for use in a chained invocation
      • addXrefsValue

        @CanIgnoreReturnValue
        public final Meta.Builder addXrefsValue​(String element)
        Adds one element to xrefsValues list.
        Parameters:
        element - A xrefsValues element
        Returns:
        this builder for use in a chained invocation
      • addXrefsValues

        @CanIgnoreReturnValue
        public final Meta.Builder addXrefsValues​(String... elements)
        Adds elements to xrefsValues list.
        Parameters:
        elements - An array of xrefsValues elements
        Returns:
        this builder for use in a chained invocation
      • xrefsValues

        @CanIgnoreReturnValue
        public final Meta.Builder xrefsValues​(Iterable<String> elements)
        Sets or replaces all elements for xrefsValues list.
        Parameters:
        elements - An iterable of xrefsValues elements
        Returns:
        this builder for use in a chained invocation
      • addAllXrefsValues

        @CanIgnoreReturnValue
        public final Meta.Builder addAllXrefsValues​(Iterable<String> elements)
        Adds elements to xrefsValues list.
        Parameters:
        elements - An iterable of xrefsValues elements
        Returns:
        this builder for use in a chained invocation
      • addBasicPropertyValue

        @CanIgnoreReturnValue
        public final Meta.Builder addBasicPropertyValue​(BasicPropertyValue element)
        Adds one element to basicPropertyValues list.
        Parameters:
        element - A basicPropertyValues element
        Returns:
        this builder for use in a chained invocation
      • addBasicPropertyValues

        @CanIgnoreReturnValue
        public final Meta.Builder addBasicPropertyValues​(BasicPropertyValue... elements)
        Adds elements to basicPropertyValues list.
        Parameters:
        elements - An array of basicPropertyValues elements
        Returns:
        this builder for use in a chained invocation
      • basicPropertyValues

        @CanIgnoreReturnValue
        public final Meta.Builder basicPropertyValues​(Iterable<? extends BasicPropertyValue> elements)
        Sets or replaces all elements for basicPropertyValues list.
        Parameters:
        elements - An iterable of basicPropertyValues elements
        Returns:
        this builder for use in a chained invocation
      • addAllBasicPropertyValues

        @CanIgnoreReturnValue
        public final Meta.Builder addAllBasicPropertyValues​(Iterable<? extends BasicPropertyValue> elements)
        Adds elements to basicPropertyValues list.
        Parameters:
        elements - An iterable of basicPropertyValues elements
        Returns:
        this builder for use in a chained invocation
      • version

        @CanIgnoreReturnValue
        public final Meta.Builder version​(String version)
        Initializes the value for the version attribute.

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

        Parameters:
        version - The value for version
        Returns:
        this builder for use in a chained invocation
      • deprecated

        @CanIgnoreReturnValue
        public final Meta.Builder deprecated​(boolean deprecated)
        Initializes the value for the deprecated attribute.

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

        Parameters:
        deprecated - The value for deprecated
        Returns:
        this builder for use in a chained invocation
      • build

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