Class AbstractOperandParser<T>
- java.lang.Object
-
- org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser<T>
-
- Type Parameters:
T
- operand Type
- Direct Known Subclasses:
AbstractNumericOperandParser
,BitmaskOperandParser
public abstract class AbstractOperandParser<T> extends Object
Top-level abstract class for all defined operands.
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
AND_BIT
static String
AND_BIT_VALUE
protected static int
END_OF_LIST
static String
END_OF_LIST_VALUE
protected static int
LENGTH_SHIFT
protected static int
OPERAND_LENGTH
-
Constructor Summary
Constructors Constructor Description AbstractOperandParser()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract T
create(Set<String> opValues)
Creates operand from a set of operand values.protected abstract T
parse(byte op)
Parses operand from byte value.static short
parseLength(byte op)
protected abstract void
serialize(T op, int length, boolean endOfList, io.netty.buffer.ByteBuf buffer)
Serializes operand to bytes.protected abstract String
toString(T op, boolean isFirst)
Creates a string representation of the operand.
-
-
-
Field Detail
-
AND_BIT_VALUE
public static final String AND_BIT_VALUE
- See Also:
- Constant Field Values
-
END_OF_LIST_VALUE
public static final String END_OF_LIST_VALUE
- See Also:
- Constant Field Values
-
OPERAND_LENGTH
protected static final int OPERAND_LENGTH
- See Also:
- Constant Field Values
-
END_OF_LIST
protected static final int END_OF_LIST
- See Also:
- Constant Field Values
-
AND_BIT
protected static final int AND_BIT
- See Also:
- Constant Field Values
-
LENGTH_SHIFT
protected static final int LENGTH_SHIFT
- See Also:
- Constant Field Values
-
-
Method Detail
-
parseLength
public static short parseLength(byte op)
-
create
protected abstract T create(Set<String> opValues)
Creates operand from a set of operand values.- Parameters:
opValues
- set of operand values- Returns:
- specific type of operand
-
serialize
protected abstract void serialize(T op, int length, boolean endOfList, io.netty.buffer.ByteBuf buffer)
Serializes operand to bytes.- Parameters:
op
- operand to be serializedlength
- value of the 'length' fieldendOfList
- if this operand is at the end of the listbuffer
- where the operand will be serialized to
-
parse
protected abstract T parse(byte op)
Parses operand from byte value.- Parameters:
op
- byte representation of an operand- Returns:
- operand object
-
-