public class NodeRef extends Object
nodeId
or foreignSource
AND foreignId
fields.
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.Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static List<NodeRef> |
from(GenericVertex vertex)
Creates
NodeRef s from a GenericVertex . |
static NodeRef |
from(int nodeId)
Creates a
NodeRef with only the nodeId field set. |
static NodeRef |
from(int nodeId,
String foreignSource,
String foreignId)
Creates a
NodeRef with all fields populated |
static NodeRef |
from(String nodeRefCriteria)
Creates a new
NodeRef object from a string. |
static NodeRef |
from(String foreignSource,
String foreignId)
Explicitly use foreignSource and foreignId to create a
NodeRef object. |
String |
getForeignId() |
String |
getForeignSource() |
Integer |
getNodeId() |
List<NodeRef> |
getVariants()
If nodeId, foreignSource and foreignId are set,
this returns multiple variants: nodeId and foreignSource/foreignId node refs
|
int |
hashCode() |
boolean |
matches(OnmsNode node) |
public Integer getNodeId()
public String getForeignSource()
public String getForeignId()
public boolean matches(OnmsNode node)
public List<NodeRef> getVariants()
public static NodeRef from(String nodeRefCriteria)
NodeRef
object from a string.
This can be a nodeId, but also a fs:fid string.nodeRefCriteria
- the criteriapublic static NodeRef from(String foreignSource, String foreignId)
NodeRef
object.public static NodeRef from(int nodeId, String foreignSource, String foreignId)
NodeRef
with all fields populatedpublic static List<NodeRef> from(GenericVertex vertex)
NodeRef
s from a GenericVertex
.
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 stringCopyright © 2021. All rights reserved.