Class PropertyChainAxiom.Builder

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

@NotThreadSafe public static final class PropertyChainAxiom.Builder extends Object
Builds instances of type PropertyChainAxiom. 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 PropertyChainAxiom instances.
       new PropertyChainAxiom.Builder()
          .meta(org.geneontology.obographs.core.model.Meta | null) // nullable meta
          .predicateId(String) // required predicateId
          .addChainPredicateId|addAllChainPredicateIds(String) // chainPredicateIds elements
          .build();
       
  • Method Details

    • from

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

      public final PropertyChainAxiom.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 PropertyChainAxiom.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
    • predicateId

      public final PropertyChainAxiom.Builder predicateId(String predicateId)
      Initializes the value for the predicateId attribute.
      Parameters:
      predicateId - The value for predicateId
      Returns:
      this builder for use in a chained invocation
    • addChainPredicateId

      public final PropertyChainAxiom.Builder addChainPredicateId(String element)
      Adds one element to chainPredicateIds list.
      Parameters:
      element - A chainPredicateIds element
      Returns:
      this builder for use in a chained invocation
    • addChainPredicateIds

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

      public final PropertyChainAxiom.Builder chainPredicateIds(Iterable<String> elements)
      Sets or replaces all elements for chainPredicateIds list.
      Parameters:
      elements - An iterable of chainPredicateIds elements
      Returns:
      this builder for use in a chained invocation
    • addAllChainPredicateIds

      public final PropertyChainAxiom.Builder addAllChainPredicateIds(Iterable<String> elements)
      Adds elements to chainPredicateIds list.
      Parameters:
      elements - An iterable of chainPredicateIds elements
      Returns:
      this builder for use in a chained invocation
    • build

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