public class NFPropertySpec
extends java.lang.Object
The recommended interface for creating a property is to instantiate with the flag method below.
By default, an NFPropertySpec is GLOBAL, MULTIPLE, and COMPACT.
import static com.netflix.nfgraph.spec.NFPropertySpec.*;
...
NFPropertySpec spec1 = new NFPropertySpec( "property1", "foreignNodeType1", MULTIPLE | HASH );
NFPropertySpec spec2 = new NFPropertySpec( "property2", "foreignNodeType2", MULTIPLE | COMPACT | MODEL_SPECIFIC);
NFPropertySpec spec3 = new NFPropertySpec( "property2", "foreignNodeType3", SINGLE );
| Modifier and Type | Field and Description |
|---|---|
static int |
COMPACT
A
MULTIPLE property instantiated with this flag will be represented as a CompactOrdinalSet in an NFCompressedGraph. |
static int |
GLOBAL
A property spec instantiated with this flag will not be separable into connection models.
|
static int |
HASH
A
MULTIPLE property instantiated with this flag will be represented as a BitSetOrdinalSet in an NFCompressedGraph. |
static int |
MODEL_SPECIFIC
A property spec instantiated with this flag will be separable into connection models.
|
static int |
MULTIPLE
A property spec instantiated with this flag will be allowed multiple connections.
|
static int |
SINGLE
A property spec instantiated with this flag will be allowed only a single connection.
|
| Constructor and Description |
|---|
NFPropertySpec(java.lang.String name,
java.lang.String toNodeType,
boolean isGlobal,
boolean isMultiple,
boolean isHashed) |
NFPropertySpec(java.lang.String name,
java.lang.String toNodeType,
int flags)
The recommended constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName() |
int |
getPropertyIndex()
Used by the
NFBuildGraph. |
java.lang.String |
getToNodeType() |
boolean |
isCompact() |
boolean |
isConnectionModelSpecific() |
boolean |
isGlobal() |
boolean |
isHashed() |
boolean |
isMultiple() |
boolean |
isSingle() |
public static final int GLOBAL
public static final int MODEL_SPECIFIC
public static final int MULTIPLE
public static final int SINGLE
public static final int HASH
MULTIPLE property instantiated with this flag will be represented as a BitSetOrdinalSet in an NFCompressedGraph.BitSetOrdinalSet,
Constant Field Valuespublic static final int COMPACT
MULTIPLE property instantiated with this flag will be represented as a CompactOrdinalSet in an NFCompressedGraph.CompactOrdinalSet,
Constant Field Valuespublic NFPropertySpec(java.lang.String name,
java.lang.String toNodeType,
int flags)
name - the name of the property.toNodeType - the node type to which this property connectsflags - a bitwise-or of the various flags defined as constants in NFPropertySpec.NFPropertySpec.GLOBAL | NFPropertySpec.MULTIPLE | NFPropertySpec.COMPACTpublic NFPropertySpec(java.lang.String name,
java.lang.String toNodeType,
boolean isGlobal,
boolean isMultiple,
boolean isHashed)
public boolean isConnectionModelSpecific()
public boolean isGlobal()
public boolean isMultiple()
public boolean isSingle()
public boolean isHashed()
public boolean isCompact()
public java.lang.String getName()
public java.lang.String getToNodeType()
public int getPropertyIndex()
NFBuildGraph.
It is unlikely that this method will be required externally.