public abstract class BasicElementConfig<S> extends AllowedEntityConfig<S>
Config.FieldPresence
Modifier and Type | Field and Description |
---|---|
static String |
GRID_X
Key for grid X coordinate.
|
static String |
GRID_Y
Key for grid Y coordinate.
|
static String |
LATITUDE
Key for latitude.
|
static String |
LOC_TYPE
Key for location type (geo or grid).
|
static String |
LOC_TYPE_GEO |
static String |
LOC_TYPE_GRID |
static String |
LOC_TYPE_NONE |
static String |
LONGITUDE
Key for longitude.
|
static String |
NAME
Key for friendly name.
|
protected static String |
OWNER
Key for owner.
|
protected static String |
RACK_ADDRESS
Key for rack address.
|
protected static String |
ROLES
Key for roles.
|
static 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(Double x)
Sets the element grid x-coordinate.
|
double |
gridY()
Returns element grid y-coordinate.
|
BasicElementConfig |
gridY(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(Double latitude)
Sets the element latitude.
|
String |
locType()
Returns the location type (geo or grid) for the element in
the Topology View.
|
BasicElementConfig |
locType(String locType)
Sets the location type (geo or grid) for the element in
the Topology View.
|
double |
longitude()
Returns element longitude.
|
BasicElementConfig |
longitude(Double longitude)
Sets the element longitude.
|
String |
name()
Returns friendly label for the element.
|
BasicElementConfig |
name(String name)
Sets friendly label for the element.
|
String |
owner()
Returns owner of the element.
|
BasicElementConfig |
owner(String owner)
Sets the owner of the element.
|
String |
rackAddress()
Returns the element rack address.
|
BasicElementConfig |
rackAddress(String address)
Sets element rack address.
|
Set<String> |
roles()
Returns set of roles assigned to the element.
|
BasicElementConfig |
roles(Set<String> roles)
Sets the roles of the element.
|
String |
uiType()
Returns the UI type (glyph image to be used) for the element in
the Topology View.
|
BasicElementConfig |
uiType(String uiType)
Sets the UI type (glyph image to be used) for the element in
the Topology View.
|
isAllowed, isAllowed
apply, 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, toString
public static final String NAME
public static final String UI_TYPE
public static final String LOC_TYPE
public static final String LATITUDE
public static final String LONGITUDE
public static final String GRID_Y
public static final String GRID_X
protected static final String RACK_ADDRESS
protected static final String OWNER
protected static final String ROLES
protected static final double ZERO_THRESHOLD
public static final String LOC_TYPE_GEO
public static final String LOC_TYPE_GRID
public static final String LOC_TYPE_NONE
public String name()
public BasicElementConfig name(String name)
name
- new friendly label; null to clearpublic String uiType()
public BasicElementConfig uiType(String uiType)
uiType
- the UI type; null for defaultpublic String locType()
public BasicElementConfig locType(String locType)
locType
- the UI type; null for defaultpublic boolean geoCoordsSet()
public double latitude()
geoCoordsSet()
public BasicElementConfig latitude(Double latitude)
latitude
- new latitude; null to clearpublic double longitude()
geoCoordsSet()
public BasicElementConfig longitude(Double longitude)
longitude
- new longitude; null to clearpublic boolean gridCoordsSet()
public double gridY()
public BasicElementConfig gridY(Double y)
y
- new y-coordinate; null to clearpublic double gridX()
public BasicElementConfig gridX(Double x)
x
- new x-coordinate; null to clearpublic String rackAddress()
public BasicElementConfig rackAddress(String address)
address
- new rack address; null to clearpublic String owner()
public BasicElementConfig owner(String owner)
owner
- new owner; null to clearpublic Set<String> roles()
public BasicElementConfig roles(Set<String> roles)
roles
- new roles; null to clearpublic boolean isValid()
Config
Default implementation returns true. Subclasses are expected to override this with their own validation. Implementations are free to throw a RuntimeException if data is invalid.