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
public abstract class AbstractNumericOperandParser<N> extends AbstractOperandParser<NumericOperand>
Common parent class for numeric operands.
-
-
Field Summary
Fields Modifier and Type Field Description static StringEQUALS_VALUEstatic StringGREATER_THAN_VALUEstatic StringLESS_THAN_VALUE-
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
Constructors Constructor Description AbstractNumericOperandParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description NumericOperandcreate(Set<String> operandValues)Creates operand from a set of operand values.NumericOperandparse(byte operand)Parses operand from byte value.protected abstract <T extends N>
voidserialize(List<T> list, io.netty.buffer.ByteBuf nlriByteBuf)Serializes specific numeric operand type depending on the length field value.voidserialize(NumericOperand operand, int length, boolean endOfList, io.netty.buffer.ByteBuf buffer)Serializes operand to bytes.protected abstract <T extends N>
StringtoString(List<T> list)StringtoString(NumericOperand operand, boolean isFirst)Creates a string representation of the operand.-
Methods inherited from class org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser
parseLength
-
-
-
-
Field Detail
-
EQUALS_VALUE
public static final String EQUALS_VALUE
- See Also:
- Constant Field Values
-
GREATER_THAN_VALUE
public static final String GREATER_THAN_VALUE
- See Also:
- Constant Field Values
-
LESS_THAN_VALUE
public static final String LESS_THAN_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public final NumericOperand create(Set<String> operandValues)
Description copied from class:AbstractOperandParserCreates operand from a set of operand values.- Specified by:
createin 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:AbstractOperandParserSerializes operand to bytes.- Specified by:
serializein 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
protected abstract <T extends N> void serialize(List<T> list, io.netty.buffer.ByteBuf nlriByteBuf)
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
public final NumericOperand parse(byte operand)
Description copied from class:AbstractOperandParserParses operand from byte value.- Specified by:
parsein classAbstractOperandParser<NumericOperand>- Parameters:
operand- byte representation of an operand- Returns:
- operand object
-
toString
public String toString(NumericOperand operand, boolean isFirst)
Description copied from class:AbstractOperandParserCreates a string representation of the operand. E.g. : 'and does not match'- Specified by:
toStringin classAbstractOperandParser<NumericOperand>- Parameters:
operand- operandisFirst- true if this operand is the first in list of operands- Returns:
- String representation of the operand
-
-