public final class PortNumber
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PortNumber.Logical
Logical PortNumbers.
|
Modifier and Type | Field and Description |
---|---|
static PortNumber |
ALL |
static PortNumber |
ANY |
static PortNumber |
CONTROLLER |
static PortNumber |
FLOOD |
static PortNumber |
IN_PORT |
static PortNumber |
LOCAL |
static PortNumber |
NORMAL |
static PortNumber |
P0 |
static PortNumber |
TABLE |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
boolean |
exactlyEquals(PortNumber that)
Indicates whether some other PortNumber object is equal to this one
including it's name.
|
static PortNumber |
fromString(java.lang.String s)
Returns PortNumber instance from String representation.
|
int |
hashCode() |
boolean |
hasName()
Indicates whether this port number was created with a port name,
or only with a number.
|
boolean |
isLogical()
Indicates whether or not this port number is a reserved logical one or
whether it corresponds to a normal physical port of a device or NIC.
|
java.lang.String |
name()
Returns the backing string value.
|
static PortNumber |
portNumber(long number)
Returns the port number representing the specified long value.
|
static PortNumber |
portNumber(long number,
java.lang.String name)
Returns the port number representing the specified long value and name.
|
static PortNumber |
portNumber(java.lang.String string)
Returns the port number representing the specified string value.
|
long |
toLong()
Returns the backing long value.
|
java.lang.String |
toString() |
public static final PortNumber P0
public static final PortNumber IN_PORT
public static final PortNumber TABLE
public static final PortNumber NORMAL
public static final PortNumber FLOOD
public static final PortNumber ALL
public static final PortNumber LOCAL
public static final PortNumber CONTROLLER
public static final PortNumber ANY
public static PortNumber portNumber(long number)
number
- port number as long valuepublic static PortNumber portNumber(java.lang.String string)
string
- port number as decimal, hexadecimal, or octal number stringpublic static PortNumber portNumber(long number, java.lang.String name)
number
- port number as long valuename
- port name as string valuepublic static PortNumber fromString(java.lang.String s)
s
- String representation equivalent to toString()
PortNumber
instancejava.lang.IllegalArgumentException
- if given String was malformedpublic boolean isLogical()
public long toLong()
public java.lang.String name()
public boolean hasName()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean exactlyEquals(PortNumber that)
that
- other PortNumber
instance to compare