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 classDefaultPortDescription.Builder
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultPortDescription()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultPortDescription.Builderbuilder()Creates port description builder with default parameters.static DefaultPortDescription.Builderbuilder(PortDescription desc)Creates port description builder inheriting with default parameters, from specified port description.booleanequals(java.lang.Object object)inthashCode()booleanisEnabled()Indicates whether or not the port is up and active.booleanisRemoved()Indicates whether or not the port was removed.PortNumberportNumber()Returns the port number.longportSpeed()Returns the current port speed in Mbps.java.lang.StringtoString()Port.Typetype()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:PortDescriptionReturns the port number.- Specified by:
portNumberin interfacePortDescription- Returns:
- port number
-
isEnabled
public boolean isEnabled()
Description copied from interface:PortDescriptionIndicates whether or not the port is up and active.- Specified by:
isEnabledin interfacePortDescription- Returns:
- true if the port is active and has carrier signal
-
isRemoved
public boolean isRemoved()
Description copied from interface:PortDescriptionIndicates whether or not the port was removed.- Specified by:
isRemovedin interfacePortDescription- Returns:
- true if the port is removed.
-
type
public Port.Type type()
Description copied from interface:PortDescriptionReturns the port type.- Specified by:
typein interfacePortDescription- Returns:
- port type
-
portSpeed
public long portSpeed()
Description copied from interface:PortDescriptionReturns the current port speed in Mbps.- Specified by:
portSpeedin interfacePortDescription- Returns:
- current port speed
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractDescription
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin 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
-
-