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 Details

  • Constructor Details

    • AbstractOperandParser

      public AbstractOperandParser()
  • Method Details

    • 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 serialized
      length - value of the 'length' field
      endOfList - if this operand is at the end of the list
      buffer - 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
    • toString

      protected abstract String toString(T op, boolean isFirst)
      Creates a string representation of the operand. E.g. : 'and does not match'
      Parameters:
      op - operand
      isFirst - true if this operand is the first in list of operands
      Returns:
      String representation of the operand