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 typePropertyChainAxiom. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()Creates a builder forPropertyChainAxiominstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyChainAxiom.BuilderaddAllChainPredicateIds(Iterable<String> elements)Adds elements tochainPredicateIdslist.PropertyChainAxiom.BuilderaddChainPredicateId(String element)Adds one element tochainPredicateIdslist.PropertyChainAxiom.BuilderaddChainPredicateIds(String... elements)Adds elements tochainPredicateIdslist.PropertyChainAxiombuild()Builds a newPropertyChainAxiom.PropertyChainAxiom.BuilderchainPredicateIds(Iterable<String> elements)Sets or replaces all elements forchainPredicateIdslist.PropertyChainAxiom.Builderfrom(AbstractPropertyChainAxiom instance)Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.axiom.AbstractPropertyChainAxiominstance.PropertyChainAxiom.Builderfrom(Axiom instance)Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.axiom.Axiominstance.PropertyChainAxiom.Buildermeta(Meta meta)Initializes the value for themetaattribute.PropertyChainAxiom.BuilderpredicateId(String predicateId)Initializes the value for thepredicateIdattribute.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forPropertyChainAxiominstances.new PropertyChainAxiom.Builder() .meta(org.geneontology.obographs.core.model.Meta | null) // nullablemeta.predicateId(String) // requiredpredicateId.addChainPredicateId|addAllChainPredicateIds(String) //chainPredicateIdselements .build();
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final PropertyChainAxiom.Builder from(AbstractPropertyChainAxiom instance)
Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.axiom.AbstractPropertyChainAxiominstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final PropertyChainAxiom.Builder from(Axiom instance)
Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.axiom.Axiominstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
meta
@CanIgnoreReturnValue public final PropertyChainAxiom.Builder meta(@Nullable Meta meta)
Initializes the value for themetaattribute.- Parameters:
meta- The value for meta (can benull)- Returns:
thisbuilder for use in a chained invocation
-
predicateId
@CanIgnoreReturnValue public final PropertyChainAxiom.Builder predicateId(String predicateId)
Initializes the value for thepredicateIdattribute.- Parameters:
predicateId- The value for predicateId- Returns:
thisbuilder for use in a chained invocation
-
addChainPredicateId
@CanIgnoreReturnValue public final PropertyChainAxiom.Builder addChainPredicateId(String element)
Adds one element tochainPredicateIdslist.- Parameters:
element- A chainPredicateIds element- Returns:
thisbuilder for use in a chained invocation
-
addChainPredicateIds
@CanIgnoreReturnValue public final PropertyChainAxiom.Builder addChainPredicateIds(String... elements)
Adds elements tochainPredicateIdslist.- Parameters:
elements- An array of chainPredicateIds elements- Returns:
thisbuilder for use in a chained invocation
-
chainPredicateIds
@CanIgnoreReturnValue public final PropertyChainAxiom.Builder chainPredicateIds(Iterable<String> elements)
Sets or replaces all elements forchainPredicateIdslist.- Parameters:
elements- An iterable of chainPredicateIds elements- Returns:
thisbuilder for use in a chained invocation
-
addAllChainPredicateIds
@CanIgnoreReturnValue public final PropertyChainAxiom.Builder addAllChainPredicateIds(Iterable<String> elements)
Adds elements tochainPredicateIdslist.- Parameters:
elements- An iterable of chainPredicateIds elements- Returns:
thisbuilder for use in a chained invocation
-
build
public PropertyChainAxiom build()
Builds a newPropertyChainAxiom.- Returns:
- An immutable instance of PropertyChainAxiom
- Throws:
IllegalStateException- if any required attributes are missing
-
-