Class Node
- java.lang.Object
-
- org.geneontology.obographs.core.model.AbstractNode
-
- org.geneontology.obographs.core.model.Node
-
- All Implemented Interfaces:
Comparable<AbstractNode>,NodeOrEdge
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class Node extends AbstractNode
A graph node corresponds to a class, individual or property - Author:
- cjm
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNode.BuilderBuilds instances of typeNode.-
Nested classes/interfaces inherited from class org.geneontology.obographs.core.model.AbstractNode
AbstractNode.RDFTYPES
-
-
Field Summary
-
Fields inherited from interface org.geneontology.obographs.core.model.NodeOrEdge
EMPTY_META
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NodecopyOf(AbstractNode instance)Creates an immutable copy of aAbstractNodevalue.booleanequals(Object another)This instance is equal to all instances ofNodethat have equal attribute values.StringgetId()StringgetLabel()MetagetMeta()AbstractNode.RDFTYPESgetType()inthashCode()Computes a hash code from attributes:meta,id,label,type.StringtoString()Prints the immutable valueNodewith attribute values.NodewithId(String value)Copy the current immutable object by setting a value for theidattribute.NodewithLabel(String value)Copy the current immutable object by setting a value for thelabelattribute.NodewithMeta(Meta value)Copy the current immutable object by setting a value for themetaattribute.NodewithType(AbstractNode.RDFTYPES value)Copy the current immutable object by setting a value for thetypeattribute.-
Methods inherited from class org.geneontology.obographs.core.model.AbstractNode
compareTo
-
-
-
-
Method Detail
-
getMeta
@Nullable public Meta getMeta()
- Returns:
- the meta
-
getId
public String getId()
- Overrides:
getIdin classAbstractNode- Returns:
- The value of the
idattribute
-
getLabel
public String getLabel()
- Overrides:
getLabelin classAbstractNode- Returns:
- The value of the
labelattribute
-
getType
@Nullable public AbstractNode.RDFTYPES getType()
- Specified by:
getTypein classAbstractNode- Returns:
- The value of the
typeattribute
-
withMeta
public final Node withMeta(@Nullable Meta value)
Copy the current immutable object by setting a value for themetaattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for meta (can benull)- Returns:
- A modified copy of the
thisobject
-
withId
public final Node withId(String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withLabel
public final Node withLabel(String value)
Copy the current immutable object by setting a value for thelabelattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for label- Returns:
- A modified copy of the
thisobject
-
withType
public final Node withType(@Nullable AbstractNode.RDFTYPES value)
Copy the current immutable object by setting a value for thetypeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofNodethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:meta,id,label,type.
-
toString
public String toString()
Prints the immutable valueNodewith attribute values.
-
copyOf
public static Node copyOf(AbstractNode instance)
Creates an immutable copy of aAbstractNodevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Node instance
-
-