Class Graph.Builder
java.lang.Object
org.geneontology.obographs.core.model.Graph.Builder
- Enclosing class:
- Graph
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Graph.BuilderaddAllDomainRangeAxioms(Iterable<? extends DomainRangeAxiom> elements) Adds elements todomainRangeAxiomslist.final Graph.BuilderaddAllEdges(Iterable<? extends Edge> elements) Adds elements toedgeslist.final Graph.BuilderaddAllEquivalentNodesSets(Iterable<? extends EquivalentNodesSet> elements) Adds elements toequivalentNodesSetslist.final Graph.BuilderaddAllLogicalDefinitionAxioms(Iterable<? extends LogicalDefinitionAxiom> elements) Adds elements tologicalDefinitionAxiomslist.final Graph.BuilderaddAllNodes(Iterable<? extends Node> elements) Adds elements tonodeslist.final Graph.BuilderaddAllPropertyChainAxioms(Iterable<? extends PropertyChainAxiom> elements) Adds elements topropertyChainAxiomslist.final Graph.BuilderaddDomainRangeAxiom(DomainRangeAxiom element) Adds one element todomainRangeAxiomslist.final Graph.BuilderaddDomainRangeAxioms(DomainRangeAxiom... elements) Adds elements todomainRangeAxiomslist.final Graph.BuilderAdds one element toedgeslist.final Graph.BuilderAdds elements toedgeslist.final Graph.BuilderaddEquivalentNodesSet(EquivalentNodesSet element) Adds one element toequivalentNodesSetslist.final Graph.BuilderaddEquivalentNodesSets(EquivalentNodesSet... elements) Adds elements toequivalentNodesSetslist.final Graph.BuilderAdds one element tologicalDefinitionAxiomslist.final Graph.BuilderaddLogicalDefinitionAxioms(LogicalDefinitionAxiom... elements) Adds elements tologicalDefinitionAxiomslist.final Graph.BuilderAdds one element tonodeslist.final Graph.BuilderAdds elements tonodeslist.final Graph.BuilderaddPropertyChainAxiom(PropertyChainAxiom element) Adds one element topropertyChainAxiomslist.final Graph.BuilderaddPropertyChainAxioms(PropertyChainAxiom... elements) Adds elements topropertyChainAxiomslist.build()Builds a newGraph.final Graph.BuilderdomainRangeAxioms(Iterable<? extends DomainRangeAxiom> elements) Sets or replaces all elements fordomainRangeAxiomslist.final Graph.BuilderSets or replaces all elements foredgeslist.final Graph.BuilderequivalentNodesSets(Iterable<? extends EquivalentNodesSet> elements) Sets or replaces all elements forequivalentNodesSetslist.final Graph.Builderfrom(AbstractGraph instance) Fill a builder with attribute values from the providedAbstractGraphinstance.final Graph.BuilderInitializes the value for theidattribute.final Graph.BuilderInitializes the value for thelblattribute.final Graph.BuilderlogicalDefinitionAxioms(Iterable<? extends LogicalDefinitionAxiom> elements) Sets or replaces all elements forlogicalDefinitionAxiomslist.final Graph.BuilderInitializes the value for themetaattribute.final Graph.BuilderSets or replaces all elements fornodeslist.final Graph.BuilderpropertyChainAxioms(Iterable<? extends PropertyChainAxiom> elements) Sets or replaces all elements forpropertyChainAxiomslist.
-
Constructor Details
-
Builder
public Builder()Creates a builder forGraphinstances.new Graph.Builder() .id(String) // optionalid.lbl(String) // optionallbl.meta(org.geneontology.obographs.core.model.Meta | null) // nullablemeta.addNode|addAllNodes(Node) //nodeselements .addEdge|addAllEdges(Edge) //edgeselements .addEquivalentNodesSet|addAllEquivalentNodesSets(org.geneontology.obographs.core.model.axiom.EquivalentNodesSet) //equivalentNodesSetselements .addLogicalDefinitionAxiom|addAllLogicalDefinitionAxioms(org.geneontology.obographs.core.model.axiom.LogicalDefinitionAxiom) //logicalDefinitionAxiomselements .addDomainRangeAxiom|addAllDomainRangeAxioms(org.geneontology.obographs.core.model.axiom.DomainRangeAxiom) //domainRangeAxiomselements .addPropertyChainAxiom|addAllPropertyChainAxioms(org.geneontology.obographs.core.model.axiom.PropertyChainAxiom) //propertyChainAxiomselements .build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedAbstractGraphinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
id
Initializes the value for theidattribute.If not set, this attribute will have a default value as returned by the initializer of
id.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
lbl
Initializes the value for thelblattribute.If not set, this attribute will have a default value as returned by the initializer of
lbl.- Parameters:
lbl- The value for lbl- 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
-
addNode
Adds one element tonodeslist.- Parameters:
element- A nodes element- Returns:
thisbuilder for use in a chained invocation
-
addNodes
Adds elements tonodeslist.- Parameters:
elements- An array of nodes elements- Returns:
thisbuilder for use in a chained invocation
-
nodes
Sets or replaces all elements fornodeslist.- Parameters:
elements- An iterable of nodes elements- Returns:
thisbuilder for use in a chained invocation
-
addAllNodes
Adds elements tonodeslist.- Parameters:
elements- An iterable of nodes elements- Returns:
thisbuilder for use in a chained invocation
-
addEdge
Adds one element toedgeslist.- Parameters:
element- A edges element- Returns:
thisbuilder for use in a chained invocation
-
addEdges
Adds elements toedgeslist.- Parameters:
elements- An array of edges elements- Returns:
thisbuilder for use in a chained invocation
-
edges
Sets or replaces all elements foredgeslist.- Parameters:
elements- An iterable of edges elements- Returns:
thisbuilder for use in a chained invocation
-
addAllEdges
Adds elements toedgeslist.- Parameters:
elements- An iterable of edges elements- Returns:
thisbuilder for use in a chained invocation
-
addEquivalentNodesSet
Adds one element toequivalentNodesSetslist.- Parameters:
element- A equivalentNodesSets element- Returns:
thisbuilder for use in a chained invocation
-
addEquivalentNodesSets
Adds elements toequivalentNodesSetslist.- Parameters:
elements- An array of equivalentNodesSets elements- Returns:
thisbuilder for use in a chained invocation
-
equivalentNodesSets
Sets or replaces all elements forequivalentNodesSetslist.- Parameters:
elements- An iterable of equivalentNodesSets elements- Returns:
thisbuilder for use in a chained invocation
-
addAllEquivalentNodesSets
public final Graph.Builder addAllEquivalentNodesSets(Iterable<? extends EquivalentNodesSet> elements) Adds elements toequivalentNodesSetslist.- Parameters:
elements- An iterable of equivalentNodesSets elements- Returns:
thisbuilder for use in a chained invocation
-
addLogicalDefinitionAxiom
Adds one element tologicalDefinitionAxiomslist.- Parameters:
element- A logicalDefinitionAxioms element- Returns:
thisbuilder for use in a chained invocation
-
addLogicalDefinitionAxioms
Adds elements tologicalDefinitionAxiomslist.- Parameters:
elements- An array of logicalDefinitionAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
logicalDefinitionAxioms
public final Graph.Builder logicalDefinitionAxioms(Iterable<? extends LogicalDefinitionAxiom> elements) Sets or replaces all elements forlogicalDefinitionAxiomslist.- Parameters:
elements- An iterable of logicalDefinitionAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
addAllLogicalDefinitionAxioms
public final Graph.Builder addAllLogicalDefinitionAxioms(Iterable<? extends LogicalDefinitionAxiom> elements) Adds elements tologicalDefinitionAxiomslist.- Parameters:
elements- An iterable of logicalDefinitionAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
addDomainRangeAxiom
Adds one element todomainRangeAxiomslist.- Parameters:
element- A domainRangeAxioms element- Returns:
thisbuilder for use in a chained invocation
-
addDomainRangeAxioms
Adds elements todomainRangeAxiomslist.- Parameters:
elements- An array of domainRangeAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
domainRangeAxioms
Sets or replaces all elements fordomainRangeAxiomslist.- Parameters:
elements- An iterable of domainRangeAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
addAllDomainRangeAxioms
Adds elements todomainRangeAxiomslist.- Parameters:
elements- An iterable of domainRangeAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
addPropertyChainAxiom
Adds one element topropertyChainAxiomslist.- Parameters:
element- A propertyChainAxioms element- Returns:
thisbuilder for use in a chained invocation
-
addPropertyChainAxioms
Adds elements topropertyChainAxiomslist.- Parameters:
elements- An array of propertyChainAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
propertyChainAxioms
Sets or replaces all elements forpropertyChainAxiomslist.- Parameters:
elements- An iterable of propertyChainAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
addAllPropertyChainAxioms
public final Graph.Builder addAllPropertyChainAxioms(Iterable<? extends PropertyChainAxiom> elements) Adds elements topropertyChainAxiomslist.- Parameters:
elements- An iterable of propertyChainAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newGraph.- Returns:
- An immutable instance of Graph
- Throws:
IllegalStateException- if any required attributes are missing
-