Package org.onosproject.net.device
Class DefaultPortDescription
- java.lang.Object
-
- org.onosproject.net.AbstractDescription
-
- org.onosproject.net.device.DefaultPortDescription
-
- All Implemented Interfaces:
Annotated
,Description
,PortDescription
public class DefaultPortDescription extends AbstractDescription implements PortDescription
Default implementation of immutable port description.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultPortDescription.Builder
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultPortDescription()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultPortDescription.Builder
builder()
Creates port description builder with default parameters.static DefaultPortDescription.Builder
builder(PortDescription desc)
Creates port description builder inheriting with default parameters, from specified port description.boolean
equals(Object object)
int
hashCode()
boolean
isEnabled()
Indicates whether or not the port is up and active.boolean
isRemoved()
Indicates whether or not the port was removed.PortNumber
portNumber()
Returns the port number.long
portSpeed()
Returns the current port speed in Mbps.String
toString()
Port.Type
type()
Returns the port type.-
Methods inherited from class org.onosproject.net.AbstractDescription
annotations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.net.Description
annotations
-
-
-
-
Method Detail
-
portNumber
public PortNumber portNumber()
Description copied from interface:PortDescription
Returns the port number.- Specified by:
portNumber
in interfacePortDescription
- Returns:
- port number
-
isEnabled
public boolean isEnabled()
Description copied from interface:PortDescription
Indicates whether or not the port is up and active.- Specified by:
isEnabled
in interfacePortDescription
- Returns:
- true if the port is active and has carrier signal
-
isRemoved
public boolean isRemoved()
Description copied from interface:PortDescription
Indicates whether or not the port was removed.- Specified by:
isRemoved
in interfacePortDescription
- Returns:
- true if the port is removed.
-
type
public Port.Type type()
Description copied from interface:PortDescription
Returns the port type.- Specified by:
type
in interfacePortDescription
- Returns:
- port type
-
portSpeed
public long portSpeed()
Description copied from interface:PortDescription
Returns the current port speed in Mbps.- Specified by:
portSpeed
in interfacePortDescription
- Returns:
- current port speed
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractDescription
-
equals
public boolean equals(Object object)
- Overrides:
equals
in classAbstractDescription
-
builder
public static DefaultPortDescription.Builder builder()
Creates port description builder with default parameters.- Returns:
- builder
-
builder
public static DefaultPortDescription.Builder builder(PortDescription desc)
Creates port description builder inheriting with default parameters, from specified port description.- Parameters:
desc
- to inherit default from- Returns:
- builder
-
-