Class Node.Builder
java.lang.Object
org.geneontology.obographs.core.model.Node.Builder
- Enclosing class:
- Node
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newNode.final Node.Builderfrom(AbstractNode instance) Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.AbstractNodeinstance.final Node.Builderfrom(NodeOrEdge instance) Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.NodeOrEdgeinstance.final Node.BuilderInitializes the value for theidattribute.final Node.BuilderInitializes the value for thelabelattribute.final Node.BuilderInitializes the value for themetaattribute.final Node.BuilderpropertyType(AbstractNode.PropertyType propertyType) Initializes the value for thepropertyTypeattribute.final Node.Buildertype(AbstractNode.RDFTYPES type) Initializes the value for thetypeattribute.
-
Constructor Details
-
Builder
public Builder()Creates a builder forNodeinstances.new Node.Builder() .meta(org.geneontology.obographs.core.model.Meta | null) // nullablemeta.id(String) // optionalid.label(String) // optionallabel.type(org.geneontology.obographs.core.model.AbstractNode.RDFTYPES | null) // nullabletype.propertyType(org.geneontology.obographs.core.model.AbstractNode.PropertyType | null) // nullablepropertyType.build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedorg.geneontology.obographs.core.model.NodeOrEdgeinstance.- 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.AbstractNodeinstance.- 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
-
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
-
label
Initializes the value for thelabelattribute.If not set, this attribute will have a default value as returned by the initializer of
label.- Parameters:
label- The value for label- Returns:
thisbuilder for use in a chained invocation
-
type
Initializes the value for thetypeattribute.- Parameters:
type- The value for type (can benull)- Returns:
thisbuilder for use in a chained invocation
-
propertyType
Initializes the value for thepropertyTypeattribute.- Parameters:
propertyType- The value for propertyType (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newNode.- Returns:
- An immutable instance of Node
- Throws:
IllegalStateException- if any required attributes are missing
-