Package org.onosproject.net
Class DefaultPort
- java.lang.Object
-
- org.onosproject.net.AbstractAnnotated
-
- org.onosproject.net.DefaultPort
-
public class DefaultPort extends AbstractAnnotated implements Port
Default port implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_SPEED
Default port speed in Mbps.
-
Constructor Summary
Constructors Constructor Description DefaultPort(Element element, PortNumber number, boolean isEnabled, Annotations... annotations)
Creates a network element attributed to the specified provider.DefaultPort(Element element, PortNumber number, boolean isEnabled, Port.Type type, long portSpeed, Annotations... annotations)
Creates a network element attributed to the specified provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Element
element()
Returns the parent network element to which this port belongs.boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
isEnabled()
Indicates whether or not the port is currently up and active.PortNumber
number()
Returns the port number.long
portSpeed()
Returns the current port speed in Mbps.java.lang.String
toString()
Port.Type
type()
Returns the port type.-
Methods inherited from class org.onosproject.net.AbstractAnnotated
annotations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.net.Annotated
annotations
-
-
-
-
Field Detail
-
DEFAULT_SPEED
public static final long DEFAULT_SPEED
Default port speed in Mbps.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultPort
public DefaultPort(Element element, PortNumber number, boolean isEnabled, Annotations... annotations)
Creates a network element attributed to the specified provider.- Parameters:
element
- parent network elementnumber
- port numberisEnabled
- indicator whether the port is up and activeannotations
- optional key/value annotations
-
DefaultPort
public DefaultPort(Element element, PortNumber number, boolean isEnabled, Port.Type type, long portSpeed, Annotations... annotations)
Creates a network element attributed to the specified provider.- Parameters:
element
- parent network elementnumber
- port numberisEnabled
- indicator whether the port is up and activetype
- port typeportSpeed
- port speed in Mbsannotations
- optional key/value annotations
-
-
Method Detail
-
element
public Element element()
Description copied from interface:Port
Returns the parent network element to which this port belongs.
-
number
public PortNumber number()
Description copied from interface:Port
Returns the port number.
-
isEnabled
public boolean isEnabled()
Description copied from interface:Port
Indicates whether or not the port is currently up and active.
-
portSpeed
public long portSpeed()
Description copied from interface:Port
Returns the current port speed in Mbps.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-