Class XrefPropertyValue.Builder

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

@NotThreadSafe public static final class XrefPropertyValue.Builder extends Object
Builds instances of type XrefPropertyValue. 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 XrefPropertyValue instances.
       new XrefPropertyValue.Builder()
          .pred(String) // optional pred
          .val(String) // optional val
          .addXref|addAllXrefs(String) // xrefs elements
          .meta(org.geneontology.obographs.core.model.Meta | null) // nullable meta
          .lbl(String) // optional lbl
          .build();
       
  • Method Details

    • from

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

      public final XrefPropertyValue.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
    • pred

      public final XrefPropertyValue.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 XrefPropertyValue.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 XrefPropertyValue.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 XrefPropertyValue.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 XrefPropertyValue.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 XrefPropertyValue.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 XrefPropertyValue.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
    • lbl

      public final XrefPropertyValue.Builder lbl(String lbl)
      Initializes the value for the lbl attribute.

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

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

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