Package org.onosproject.ui.model.topo
Class UiDevice
- java.lang.Object
-
- org.onosproject.ui.model.topo.UiElement
-
- org.onosproject.ui.model.topo.UiNode
-
- org.onosproject.ui.model.topo.UiDevice
-
public class UiDevice extends UiNode
Represents a device.
-
-
Field Summary
-
Fields inherited from class org.onosproject.ui.model.topo.UiNode
LAYER_DEFAULT, LAYER_OPTICAL, LAYER_PACKET
-
-
Constructor Summary
Constructors Constructor Description UiDevice(UiTopology topology, Device device)Creates a new UI device.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DevicebackingDevice()Returns the device instance backing this UI device.DeviceIdid()Returns the identity of the device.StringidAsString()Returns a string representation of the element identifier.RegionIdregionId()Returns the identifier of the region to which this device belongs.voidsetRegionId(RegionId regionId)Sets the ID of the region to which this device belongs.StringtoString()Stringtype()Returns a string representation of the type of the backing device.UiRegionuiRegion()Returns the UI region to which this device belongs.
-
-
-
Constructor Detail
-
UiDevice
public UiDevice(UiTopology topology, Device device)
Creates a new UI device.- Parameters:
topology- parent topologydevice- backing device
-
-
Method Detail
-
setRegionId
public void setRegionId(RegionId regionId)
Sets the ID of the region to which this device belongs.- Parameters:
regionId- region identifier
-
id
public DeviceId id()
Returns the identity of the device.- Returns:
- device ID
-
idAsString
public String idAsString()
Description copied from class:UiElementReturns a string representation of the element identifier.- Specified by:
idAsStringin classUiElement- Returns:
- the element unique identifier
-
backingDevice
public Device backingDevice()
Returns the device instance backing this UI device.- Returns:
- the backing device instance
-
regionId
public RegionId regionId()
Returns the identifier of the region to which this device belongs. This will be null if the device does not belong to any region.- Returns:
- region ID
-
uiRegion
public UiRegion uiRegion()
Returns the UI region to which this device belongs.- Returns:
- the UI region
-
type
public String type()
Returns a string representation of the type of the backing device.- Returns:
- the device type
-
-