Class Graph.Builder
- java.lang.Object
-
- org.geneontology.obographs.core.model.Graph.Builder
-
-
Method Summary
-
-
-
Constructor Detail
-
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 Detail
-
from
@CanIgnoreReturnValue public final Graph.Builder from(AbstractGraph instance)
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
@CanIgnoreReturnValue public final Graph.Builder id(String 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
@CanIgnoreReturnValue public final Graph.Builder lbl(String 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
@CanIgnoreReturnValue public final Graph.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
-
addNode
@CanIgnoreReturnValue public final Graph.Builder addNode(Node element)
Adds one element tonodeslist.- Parameters:
element- A nodes element- Returns:
thisbuilder for use in a chained invocation
-
addNodes
@CanIgnoreReturnValue public final Graph.Builder addNodes(Node... elements)
Adds elements tonodeslist.- Parameters:
elements- An array of nodes elements- Returns:
thisbuilder for use in a chained invocation
-
nodes
@CanIgnoreReturnValue public final Graph.Builder nodes(Iterable<? extends Node> elements)
Sets or replaces all elements fornodeslist.- Parameters:
elements- An iterable of nodes elements- Returns:
thisbuilder for use in a chained invocation
-
addAllNodes
@CanIgnoreReturnValue public final Graph.Builder addAllNodes(Iterable<? extends Node> elements)
Adds elements tonodeslist.- Parameters:
elements- An iterable of nodes elements- Returns:
thisbuilder for use in a chained invocation
-
addEdge
@CanIgnoreReturnValue public final Graph.Builder addEdge(Edge element)
Adds one element toedgeslist.- Parameters:
element- A edges element- Returns:
thisbuilder for use in a chained invocation
-
addEdges
@CanIgnoreReturnValue public final Graph.Builder addEdges(Edge... elements)
Adds elements toedgeslist.- Parameters:
elements- An array of edges elements- Returns:
thisbuilder for use in a chained invocation
-
edges
@CanIgnoreReturnValue public final Graph.Builder edges(Iterable<? extends Edge> elements)
Sets or replaces all elements foredgeslist.- Parameters:
elements- An iterable of edges elements- Returns:
thisbuilder for use in a chained invocation
-
addAllEdges
@CanIgnoreReturnValue public final Graph.Builder addAllEdges(Iterable<? extends Edge> elements)
Adds elements toedgeslist.- Parameters:
elements- An iterable of edges elements- Returns:
thisbuilder for use in a chained invocation
-
addEquivalentNodesSet
@CanIgnoreReturnValue public final Graph.Builder addEquivalentNodesSet(EquivalentNodesSet element)
Adds one element toequivalentNodesSetslist.- Parameters:
element- A equivalentNodesSets element- Returns:
thisbuilder for use in a chained invocation
-
addEquivalentNodesSets
@CanIgnoreReturnValue public final Graph.Builder addEquivalentNodesSets(EquivalentNodesSet... elements)
Adds elements toequivalentNodesSetslist.- Parameters:
elements- An array of equivalentNodesSets elements- Returns:
thisbuilder for use in a chained invocation
-
equivalentNodesSets
@CanIgnoreReturnValue public final Graph.Builder equivalentNodesSets(Iterable<? extends EquivalentNodesSet> elements)
Sets or replaces all elements forequivalentNodesSetslist.- Parameters:
elements- An iterable of equivalentNodesSets elements- Returns:
thisbuilder for use in a chained invocation
-
addAllEquivalentNodesSets
@CanIgnoreReturnValue 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
@CanIgnoreReturnValue public final Graph.Builder addLogicalDefinitionAxiom(LogicalDefinitionAxiom element)
Adds one element tologicalDefinitionAxiomslist.- Parameters:
element- A logicalDefinitionAxioms element- Returns:
thisbuilder for use in a chained invocation
-
addLogicalDefinitionAxioms
@CanIgnoreReturnValue public final Graph.Builder addLogicalDefinitionAxioms(LogicalDefinitionAxiom... elements)
Adds elements tologicalDefinitionAxiomslist.- Parameters:
elements- An array of logicalDefinitionAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
logicalDefinitionAxioms
@CanIgnoreReturnValue 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
@CanIgnoreReturnValue 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
@CanIgnoreReturnValue public final Graph.Builder addDomainRangeAxiom(DomainRangeAxiom element)
Adds one element todomainRangeAxiomslist.- Parameters:
element- A domainRangeAxioms element- Returns:
thisbuilder for use in a chained invocation
-
addDomainRangeAxioms
@CanIgnoreReturnValue public final Graph.Builder addDomainRangeAxioms(DomainRangeAxiom... elements)
Adds elements todomainRangeAxiomslist.- Parameters:
elements- An array of domainRangeAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
domainRangeAxioms
@CanIgnoreReturnValue public final Graph.Builder domainRangeAxioms(Iterable<? extends DomainRangeAxiom> elements)
Sets or replaces all elements fordomainRangeAxiomslist.- Parameters:
elements- An iterable of domainRangeAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
addAllDomainRangeAxioms
@CanIgnoreReturnValue public final Graph.Builder addAllDomainRangeAxioms(Iterable<? extends DomainRangeAxiom> elements)
Adds elements todomainRangeAxiomslist.- Parameters:
elements- An iterable of domainRangeAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
addPropertyChainAxiom
@CanIgnoreReturnValue public final Graph.Builder addPropertyChainAxiom(PropertyChainAxiom element)
Adds one element topropertyChainAxiomslist.- Parameters:
element- A propertyChainAxioms element- Returns:
thisbuilder for use in a chained invocation
-
addPropertyChainAxioms
@CanIgnoreReturnValue public final Graph.Builder addPropertyChainAxioms(PropertyChainAxiom... elements)
Adds elements topropertyChainAxiomslist.- Parameters:
elements- An array of propertyChainAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
propertyChainAxioms
@CanIgnoreReturnValue public final Graph.Builder propertyChainAxioms(Iterable<? extends PropertyChainAxiom> elements)
Sets or replaces all elements forpropertyChainAxiomslist.- Parameters:
elements- An iterable of propertyChainAxioms elements- Returns:
thisbuilder for use in a chained invocation
-
addAllPropertyChainAxioms
@CanIgnoreReturnValue 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
public Graph build()
Builds a newGraph.- Returns:
- An immutable instance of Graph
- Throws:
IllegalStateException- if any required attributes are missing
-
-