Class LogicalDefinitionAxiom.Builder
java.lang.Object
org.geneontology.obographs.core.model.axiom.LogicalDefinitionAxiom.Builder
- Enclosing class:
- LogicalDefinitionAxiom
Builds instances of type
LogicalDefinitionAxiom.
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllGenusIds(Iterable<String> elements) Adds elements togenusIdslist.addAllRestrictions(Iterable<? extends ExistentialRestrictionExpression> elements) Adds elements torestrictionslist.addGenusId(String element) Adds one element togenusIdslist.addGenusIds(String... elements) Adds elements togenusIdslist.Adds one element torestrictionslist.addRestrictions(ExistentialRestrictionExpression... elements) Adds elements torestrictionslist.build()Builds a newLogicalDefinitionAxiom.definedClassId(String definedClassId) Initializes the value for thedefinedClassIdattribute.from(AbstractLogicalDefinitionAxiom instance) Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.axiom.AbstractLogicalDefinitionAxiominstance.Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.axiom.Axiominstance.Sets or replaces all elements forgenusIdslist.Initializes the value for themetaattribute.restrictions(Iterable<? extends ExistentialRestrictionExpression> elements) Sets or replaces all elements forrestrictionslist.
-
Constructor Details
-
Builder
public Builder()Creates a builder forLogicalDefinitionAxiominstances.new LogicalDefinitionAxiom.Builder() .meta(org.geneontology.obographs.core.model.Meta | null) // nullablemeta.definedClassId(String) // requireddefinedClassId.addGenusId|addAllGenusIds(String) //genusIdselements .addRestriction|addAllRestrictions(ExistentialRestrictionExpression) //restrictionselements .build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.axiom.AbstractLogicalDefinitionAxiominstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
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
Initializes the value for themetaattribute.- Parameters:
meta- The value for meta (can benull)- Returns:
thisbuilder for use in a chained invocation
-
definedClassId
Initializes the value for thedefinedClassIdattribute.- Parameters:
definedClassId- The value for definedClassId- Returns:
thisbuilder for use in a chained invocation
-
addGenusId
Adds one element togenusIdslist.- Parameters:
element- A genusIds element- Returns:
thisbuilder for use in a chained invocation
-
addGenusIds
Adds elements togenusIdslist.- Parameters:
elements- An array of genusIds elements- Returns:
thisbuilder for use in a chained invocation
-
genusIds
Sets or replaces all elements forgenusIdslist.- Parameters:
elements- An iterable of genusIds elements- Returns:
thisbuilder for use in a chained invocation
-
addAllGenusIds
Adds elements togenusIdslist.- Parameters:
elements- An iterable of genusIds elements- Returns:
thisbuilder for use in a chained invocation
-
addRestriction
public final LogicalDefinitionAxiom.Builder addRestriction(ExistentialRestrictionExpression element) Adds one element torestrictionslist.- Parameters:
element- A restrictions element- Returns:
thisbuilder for use in a chained invocation
-
addRestrictions
public final LogicalDefinitionAxiom.Builder addRestrictions(ExistentialRestrictionExpression... elements) Adds elements torestrictionslist.- Parameters:
elements- An array of restrictions elements- Returns:
thisbuilder for use in a chained invocation
-
restrictions
public final LogicalDefinitionAxiom.Builder restrictions(Iterable<? extends ExistentialRestrictionExpression> elements) Sets or replaces all elements forrestrictionslist.- Parameters:
elements- An iterable of restrictions elements- Returns:
thisbuilder for use in a chained invocation
-
addAllRestrictions
public final LogicalDefinitionAxiom.Builder addAllRestrictions(Iterable<? extends ExistentialRestrictionExpression> elements) Adds elements torestrictionslist.- Parameters:
elements- An iterable of restrictions elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newLogicalDefinitionAxiom.- Returns:
- An immutable instance of LogicalDefinitionAxiom
- Throws:
IllegalStateException- if any required attributes are missing
-