public abstract class BasicElementConfig<S> extends AllowedEntityConfig<S>
Config.FieldPresence| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
GRID_X
Key for grid X coordinate.
|
static java.lang.String |
GRID_Y
Key for grid Y coordinate.
|
static java.lang.String |
LATITUDE
Key for latitude.
|
static java.lang.String |
LOC_TYPE
Key for location type (geo or grid).
|
static java.lang.String |
LOC_TYPE_GEO |
static java.lang.String |
LOC_TYPE_GRID |
static java.lang.String |
LOC_TYPE_NONE |
static java.lang.String |
LONGITUDE
Key for longitude.
|
static java.lang.String |
NAME
Key for friendly name.
|
protected static java.lang.String |
OWNER
Key for owner.
|
protected static java.lang.String |
RACK_ADDRESS
Key for rack address.
|
protected static java.lang.String |
ROLES
Key for roles.
|
static java.lang.String |
UI_TYPE
Key for UI type (glyph identifier).
|
protected static double |
ZERO_THRESHOLD
Threshold for detecting double value is zero.
|
ALLOWED| Constructor and Description |
|---|
BasicElementConfig() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
geoCoordsSet()
Returns true if the geographical coordinates (latitude and longitude)
are set on this element; false otherwise.
|
boolean |
gridCoordsSet()
Returns true if the grid coordinates (gridY and gridX) are set on
this element, i.e.
|
double |
gridX()
Returns element grid x-coordinate.
|
BasicElementConfig |
gridX(java.lang.Double x)
Sets the element grid x-coordinate.
|
double |
gridY()
Returns element grid y-coordinate.
|
BasicElementConfig |
gridY(java.lang.Double y)
Sets the element grid y-coordinate.
|
boolean |
isValid()
Indicates whether or not the backing JSON node contains valid data.
|
double |
latitude()
Returns element latitude.
|
BasicElementConfig |
latitude(java.lang.Double latitude)
Sets the element latitude.
|
java.lang.String |
locType()
Returns the location type (geo or grid) for the element in
the Topology View.
|
BasicElementConfig |
locType(java.lang.String locType)
Sets the location type (geo or grid) for the element in
the Topology View.
|
double |
longitude()
Returns element longitude.
|
BasicElementConfig |
longitude(java.lang.Double longitude)
Sets the element longitude.
|
java.lang.String |
name()
Returns friendly label for the element.
|
BasicElementConfig |
name(java.lang.String name)
Sets friendly label for the element.
|
java.lang.String |
owner()
Returns owner of the element.
|
BasicElementConfig |
owner(java.lang.String owner)
Sets the owner of the element.
|
java.lang.String |
rackAddress()
Returns the element rack address.
|
BasicElementConfig |
rackAddress(java.lang.String address)
Sets element rack address.
|
java.util.Set<java.lang.String> |
roles()
Returns set of roles assigned to the element.
|
BasicElementConfig |
roles(java.util.Set<java.lang.String> roles)
Sets the roles of the element.
|
java.lang.String |
uiType()
Returns the UI type (glyph image to be used) for the element in
the Topology View.
|
BasicElementConfig |
uiType(java.lang.String uiType)
Sets the UI type (glyph image to be used) for the element in
the Topology View.
|
isAllowed, isAllowedapply, clear, get, get, get, get, get, get, getList, getList, hasField, hasField, hasFields, hasFields, hasOnlyFields, hasOnlyFields, init, isBoolean, isBoolean, isConnectPoint, isConnectPoint, isDecimal, isDecimal, isIntegralNumber, isIntegralNumber, isIpAddress, isIpAddress, isIpPrefix, isIpPrefix, isMacAddress, isMacAddress, isNumber, isNumber, isString, isString, isTpPort, isTpPort, isValidLength, key, node, setList, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, subject, toStringpublic static final java.lang.String NAME
public static final java.lang.String UI_TYPE
public static final java.lang.String LOC_TYPE
public static final java.lang.String LATITUDE
public static final java.lang.String LONGITUDE
public static final java.lang.String GRID_Y
public static final java.lang.String GRID_X
protected static final java.lang.String RACK_ADDRESS
protected static final java.lang.String OWNER
protected static final java.lang.String ROLES
protected static final double ZERO_THRESHOLD
public static final java.lang.String LOC_TYPE_GEO
public static final java.lang.String LOC_TYPE_GRID
public static final java.lang.String LOC_TYPE_NONE
public java.lang.String name()
public BasicElementConfig name(java.lang.String name)
name - new friendly label; null to clearpublic java.lang.String uiType()
public BasicElementConfig uiType(java.lang.String uiType)
uiType - the UI type; null for defaultpublic java.lang.String locType()
public BasicElementConfig locType(java.lang.String locType)
locType - the UI type; null for defaultpublic boolean geoCoordsSet()
public double latitude()
geoCoordsSet()public BasicElementConfig latitude(java.lang.Double latitude)
latitude - new latitude; null to clearpublic double longitude()
geoCoordsSet()public BasicElementConfig longitude(java.lang.Double longitude)
longitude - new longitude; null to clearpublic boolean gridCoordsSet()
public double gridY()
public BasicElementConfig gridY(java.lang.Double y)
y - new y-coordinate; null to clearpublic double gridX()
public BasicElementConfig gridX(java.lang.Double x)
x - new x-coordinate; null to clearpublic java.lang.String rackAddress()
public BasicElementConfig rackAddress(java.lang.String address)
address - new rack address; null to clearpublic java.lang.String owner()
public BasicElementConfig owner(java.lang.String owner)
owner - new owner; null to clearpublic java.util.Set<java.lang.String> roles()
public BasicElementConfig roles(java.util.Set<java.lang.String> roles)
roles - new roles; null to clearpublic boolean isValid()
ConfigDefault implementation returns true. Subclasses are expected to override this with their own validation. Implementations are free to throw a RuntimeException if data is invalid.