Package org.opennms.netmgt.graph.api
Class NodeRef
- java.lang.Object
- 
- org.opennms.netmgt.graph.api.NodeRef
 
- 
 public class NodeRef extends java.lang.ObjectObject to reference a node. This can either be done by setting thenodeIdorforeignSourceANDforeignIdfields. If created from an OnmsNode all fields may be populated. Note: This should allow for easier node referencing, however it is no guarantee that the node referenced actually exists.- Author:
- mvrueden
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)static NodeReffrom(int nodeId)Creates aNodeRefwith only thenodeIdfield set.static NodeReffrom(int nodeId, java.lang.String foreignSource, java.lang.String foreignId)Creates aNodeRefwith all fields populatedstatic NodeReffrom(java.lang.String nodeRefCriteria)Creates a newNodeRefobject from a string.static NodeReffrom(java.lang.String foreignSource, java.lang.String foreignId)Explicitly use foreignSource and foreignId to create aNodeRefobject.static java.util.List<NodeRef>from(GenericVertex vertex)CreatesNodeRefs from aGenericVertex.java.lang.StringgetForeignId()java.lang.StringgetForeignSource()java.lang.IntegergetNodeId()java.util.List<NodeRef>getVariants()If nodeId, foreignSource and foreignId are set, this returns multiple variants: nodeId and foreignSource/foreignId node refsinthashCode()booleanmatches(OnmsNode node)
 
- 
- 
- 
Method Detail- 
getNodeIdpublic java.lang.Integer getNodeId() 
 - 
getForeignSourcepublic java.lang.String getForeignSource() 
 - 
getForeignIdpublic java.lang.String getForeignId() 
 - 
matchespublic boolean matches(OnmsNode node) 
 - 
equalspublic boolean equals(java.lang.Object o) - Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
getVariantspublic java.util.List<NodeRef> getVariants() If nodeId, foreignSource and foreignId are set, this returns multiple variants: nodeId and foreignSource/foreignId node refs
 - 
frompublic static NodeRef from(java.lang.String nodeRefCriteria) Creates a newNodeRefobject from a string. This can be a nodeId, but also a fs:fid string.- Parameters:
- nodeRefCriteria- the criteria
- Returns:
- the reference to a node
 
 - 
frompublic static NodeRef from(java.lang.String foreignSource, java.lang.String foreignId) Explicitly use foreignSource and foreignId to create aNodeRefobject.
 - 
frompublic static NodeRef from(int nodeId, java.lang.String foreignSource, java.lang.String foreignId) Creates aNodeRefwith all fields populated
 - 
frompublic static java.util.List<NodeRef> from(GenericVertex vertex) CreatesNodeRefs from aGenericVertex. If multiple properties are set, they are returned in the following order: - reference defined by node id - reference defined by foreignSource/foreignId - reference defined by node criteria string
 
- 
 
-