Class EquivalentNodesSet.Builder

java.lang.Object
org.geneontology.obographs.core.model.axiom.EquivalentNodesSet.Builder
Enclosing class:
EquivalentNodesSet

@NotThreadSafe public static final class EquivalentNodesSet.Builder extends Object
Builds instances of type EquivalentNodesSet. 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 EquivalentNodesSet instances.
       new EquivalentNodesSet.Builder()
          .meta(org.geneontology.obographs.core.model.Meta | null) // nullable meta
          .representativeNodeId(String) // optional representativeNodeId
          .addNodeId|addAllNodeIds(String) // nodeIds elements
          .build();
       
  • Method Details

    • from

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

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

      public final EquivalentNodesSet.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
    • representativeNodeId

      public final EquivalentNodesSet.Builder representativeNodeId(String representativeNodeId)
      Initializes the value for the representativeNodeId attribute.

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

      Parameters:
      representativeNodeId - The value for representativeNodeId
      Returns:
      this builder for use in a chained invocation
    • addNodeId

      public final EquivalentNodesSet.Builder addNodeId(String element)
      Adds one element to nodeIds set.
      Parameters:
      element - A nodeIds element
      Returns:
      this builder for use in a chained invocation
    • addNodeIds

      public final EquivalentNodesSet.Builder addNodeIds(String... elements)
      Adds elements to nodeIds set.
      Parameters:
      elements - An array of nodeIds elements
      Returns:
      this builder for use in a chained invocation
    • nodeIds

      public final EquivalentNodesSet.Builder nodeIds(Iterable<String> elements)
      Sets or replaces all elements for nodeIds set.
      Parameters:
      elements - An iterable of nodeIds elements
      Returns:
      this builder for use in a chained invocation
    • addAllNodeIds

      public final EquivalentNodesSet.Builder addAllNodeIds(Iterable<String> elements)
      Adds elements to nodeIds set.
      Parameters:
      elements - An iterable of nodeIds elements
      Returns:
      this builder for use in a chained invocation
    • build

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