Class DefinitionPropertyValue.Builder

java.lang.Object
org.geneontology.obographs.core.model.meta.DefinitionPropertyValue.Builder
Enclosing class:
DefinitionPropertyValue

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

    • Builder

      public Builder()
      Creates a builder for DefinitionPropertyValue instances.
       new DefinitionPropertyValue.Builder()
          .pred(String) // optional pred
          .val(String) // optional val
          .addXref|addAllXrefs(String) // xrefs elements
          .meta(org.geneontology.obographs.core.model.Meta | null) // nullable meta
          .build();
       
  • Method Details

    • from

      public final DefinitionPropertyValue.Builder from(PropertyValue instance)
      Fill a builder with attribute values from the provided org.geneontology.obographs.core.model.meta.PropertyValue instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      Fill a builder with attribute values from the provided org.geneontology.obographs.core.model.meta.AbstractDefinitionPropertyValue instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • pred

      public final DefinitionPropertyValue.Builder pred(String pred)
      Initializes the value for the pred attribute.

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

      Parameters:
      pred - The value for pred
      Returns:
      this builder for use in a chained invocation
    • val

      public final DefinitionPropertyValue.Builder val(String val)
      Initializes the value for the val attribute.

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

      Parameters:
      val - The value for val
      Returns:
      this builder for use in a chained invocation
    • addXref

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

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

      public final DefinitionPropertyValue.Builder xrefs(Iterable<String> 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

      public final DefinitionPropertyValue.Builder addAllXrefs(Iterable<String> elements)
      Adds elements to xrefs list.
      Parameters:
      elements - An iterable of xrefs elements
      Returns:
      this builder for use in a chained invocation
    • meta

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

      public DefinitionPropertyValue build()
      Returns:
      An immutable instance of DefinitionPropertyValue
      Throws:
      IllegalStateException - if any required attributes are missing