public enum MeterFlag extends Enum<MeterFlag> implements OfpBitmapEnum
Enum Constant and Description |
---|
BURST
Do burst size; Since 1.3.
|
KBPS
Rate value in kb/s (kilo-bit per second); Since 1.3.
|
PKTPS
Rate value in packet/second; Since 1.3.
|
STATS
Collect statistics; Since 1.3.
|
Modifier and Type | Method and Description |
---|---|
static Set<MeterFlag> |
decodeBitmap(int bitmap,
ProtocolVersion pv)
Decodes the meter flags and returns the set of corresponding
constants.
|
static int |
encodeBitmap(Set<MeterFlag> flags,
ProtocolVersion pv)
Encodes a set of meter flags as a bitmap.
|
int |
getBit(ProtocolVersion pv)
Returns the bit value for the constant, under the given protocol
version.
|
String |
toDisplayString()
Returns a string representation of the constant, suitable for
presentation in a display.
|
String |
toString() |
static MeterFlag |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MeterFlag[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MeterFlag KBPS
public static final MeterFlag PKTPS
public static final MeterFlag BURST
public static final MeterFlag STATS
public static MeterFlag[] values()
for (MeterFlag c : MeterFlag.values()) System.out.println(c);
public static MeterFlag valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getBit(ProtocolVersion pv)
OfpBitmapEnum
getBit
in interface OfpBitmapEnum
pv
- the protocol versionpublic String toDisplayString()
OfpBitmapEnum
toDisplayString
in interface OfpBitmapEnum
public static Set<MeterFlag> decodeBitmap(int bitmap, ProtocolVersion pv)
bitmap
- the bitmap to decodepv
- the protocol versionVersionMismatchException
- if a bit position is not
supported in the given versionpublic static int encodeBitmap(Set<MeterFlag> flags, ProtocolVersion pv)
flags
parameter may be null, in which case a bitmap of 0 (zero) is returned.flags
- the flags to encodepv
- the protocol versionNullPointerException
- if protocol version is nullVersionMismatchException
- if a flag is present that is not
supported in the given protocol versionCopyright © 2016. All Rights Reserved.