Class AbstractNumericOperandParser<N>
java.lang.Object
org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser<NumericOperand>
org.opendaylight.protocol.bgp.flowspec.handlers.AbstractNumericOperandParser<N>
- Type Parameters:
N
- numeric operand type
- Direct Known Subclasses:
NumericOneByteOperandParser
,NumericTwoByteOperandParser
Common parent class for numeric operands.
-
Field Summary
Fields inherited from class org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser
AND_BIT, AND_BIT_VALUE, END_OF_LIST, END_OF_LIST_VALUE, LENGTH_SHIFT, OPERAND_LENGTH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal NumericOperand
Creates operand from a set of operand values.final NumericOperand
parse
(byte operand) Parses operand from byte value.protected abstract <T extends N>
voidSerializes specific numeric operand type depending on the length field value.final void
serialize
(NumericOperand operand, int length, boolean endOfList, io.netty.buffer.ByteBuf buffer) Serializes operand to bytes.toString
(NumericOperand operand, boolean isFirst) Creates a string representation of the operand.Methods inherited from class org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser
parseLength
-
Field Details
-
EQUALS_VALUE
- See Also:
-
GREATER_THAN_VALUE
- See Also:
-
LESS_THAN_VALUE
- See Also:
-
-
Constructor Details
-
AbstractNumericOperandParser
public AbstractNumericOperandParser()
-
-
Method Details
-
create
Description copied from class:AbstractOperandParser
Creates operand from a set of operand values.- Specified by:
create
in classAbstractOperandParser<NumericOperand>
- Parameters:
operandValues
- set of operand values- Returns:
- specific type of operand
-
serialize
public final void serialize(NumericOperand operand, int length, boolean endOfList, io.netty.buffer.ByteBuf buffer) Description copied from class:AbstractOperandParser
Serializes operand to bytes.- Specified by:
serialize
in classAbstractOperandParser<NumericOperand>
- Parameters:
operand
- 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
-
serialize
Serializes specific numeric operand type depending on the length field value.- Parameters:
list
- of operands to be serializednlriByteBuf
- where the operands will be serialized
-
parse
Description copied from class:AbstractOperandParser
Parses operand from byte value.- Specified by:
parse
in classAbstractOperandParser<NumericOperand>
- Parameters:
operand
- byte representation of an operand- Returns:
- operand object
-
toString
Description copied from class:AbstractOperandParser
Creates a string representation of the operand. E.g. : 'and does not match'- Specified by:
toString
in classAbstractOperandParser<NumericOperand>
- Parameters:
operand
- operandisFirst
- true if this operand is the first in list of operands- Returns:
- String representation of the operand
-
toString
-