Package ru.bitel.bgbilling.kernel.network.tlv

# Class TlvInfo<I extends TlvInfo<I,?,H>,V,H extends TlvHeader>

java.lang.Object
ru.bitel.bgbilling.kernel.network.tlv.TlvInfo<I,V,H>

All Implemented Interfaces:
  `Iterable<I>`

Direct Known Subclasses:
  `RadiusAttributeInfo`

public abstract class TlvInfo<I extends TlvInfo<I,?,H>,V,H extends TlvHeader> extends Object implements Iterable<I>

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final I[]`
  `children`
  `protected final List<I>`
  `childrenList`
  `protected final Map<Integer,I>`
  `childrenMap`
  `final String`
  `name`
  `protected final Map<String,I>`
  `nameChildrenMap`
  `protected final int`
  `paramLengthLength`
  `protected final int`
  `paramTypeLength`
  `protected I`
  `parent`
  `final int`
  `type`
  `static final int`
  `TYPE_ABINARY`
  `static final int`
  `TYPE_BYTE`
  `static final int`
  `TYPE_DOUBLE`
  `static final int`
  `TYPE_FLOAT`
  `static final int`
  `TYPE_INTEGER`
  `static final int`
  `TYPE_IPADDR`
  `static final int`
  `TYPE_IPV6ADDR`
  `static final int`
  `TYPE_IPV6PREFIX`
  `static final int`
  `TYPE_LONG`
  `static final int`
  `TYPE_OCTETS`
  `static final int`
  `TYPE_SHORT`
  `static final int`
  `TYPE_STRING`
  `static final int`
  `TYPE_TLV`
  `final int`
  `valueType`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TlvInfo(Class<?> clazz, int type, String name, int valueType, int paramTypeSize, int paramLengthSize, List<I> children)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `I`
  `getChild(int type)`
  `I`
  `getChild(String name)`
  `Iterator<I>`
  `iterator()`
  `abstract Tlv<?,?>`
  `read(ByteBuffer bb, H header)`
  `void`
  `readTypeLength(ByteBuffer bb, H header, int parentLength, boolean headerInLength)`
  Считывание типа и длины.
  `void`
  `setParent(I parent)`
  `protected final ByteBuffer`
  `sliceData(ByteBuffer bb, int length)`
  Получения ByteBuffer содержащего data
  `String`
  `toString()`
  `abstract V`
  `unwrapValue(ByteBuffer data)`
  `String`
  `valueToString(Tlv<?,V> attribute)`
  `abstract ByteBuffer`
  `wrapValue(V value)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

- ## Field Details

  - ### TYPE_OCTETS

    public static final int TYPE_OCTETS
    See Also:
      - Constant Field Values

  - ### TYPE_STRING

    public static final int TYPE_STRING
    See Also:
      - Constant Field Values

  - ### TYPE_LONG

    public static final int TYPE_LONG
    See Also:
      - Constant Field Values

  - ### TYPE_INTEGER

    public static final int TYPE_INTEGER
    See Also:
      - Constant Field Values

  - ### TYPE_SHORT

    public static final int TYPE_SHORT
    See Also:
      - Constant Field Values

  - ### TYPE_BYTE

    public static final int TYPE_BYTE
    See Also:
      - Constant Field Values

  - ### TYPE_DOUBLE

    public static final int TYPE_DOUBLE
    See Also:
      - Constant Field Values

  - ### TYPE_FLOAT

    public static final int TYPE_FLOAT
    See Also:
      - Constant Field Values

  - ### TYPE_TLV

    public static final int TYPE_TLV
    See Also:
      - Constant Field Values

  - ### TYPE_IPADDR

    public static final int TYPE_IPADDR
    See Also:
      - Constant Field Values

  - ### TYPE_ABINARY

    public static final int TYPE_ABINARY
    See Also:
      - Constant Field Values

  - ### TYPE_IPV6ADDR

    public static final int TYPE_IPV6ADDR
    See Also:
      - Constant Field Values

  - ### TYPE_IPV6PREFIX

    public static final int TYPE_IPV6PREFIX
    See Also:
      - Constant Field Values

  - ### paramTypeLength

    protected final int paramTypeLength

  - ### paramLengthLength

    protected final int paramLengthLength

  - ### type

    public final int type

  - ### name

    public final String name

  - ### valueType

    public final int valueType

  - ### parent

    protected I extends TlvInfo<I,?,H> parent

  - ### childrenList

    protected final List<I extends TlvInfo<I,?,H>> childrenList

  - ### children

    protected final I extends TlvInfo<I,?,H>[] children

  - ### childrenMap

    protected final Map<Integer,I extends TlvInfo<I,?,H>> childrenMap

  - ### nameChildrenMap

    protected final Map<String,I extends TlvInfo<I,?,H>> nameChildrenMap

- ## Constructor Details

  - ### TlvInfo

    public TlvInfo(Class<?> clazz, int type, String name, int valueType, int paramTypeSize, int paramLengthSize, List<I> children)

- ## Method Details

  - ### setParent

    public void setParent(I parent)

  - ### getChild

    public I getChild(int type)

  - ### getChild

    public I getChild(String name)

  - ### iterator

    public Iterator<I> iterator()
    Specified by:
      `iterator` in interface `Iterable<I extends TlvInfo<I,?,H>>`

  - ### read

    public abstract Tlv<?,?> read(ByteBuffer bb, H header)

  - ### unwrapValue

    public abstract V unwrapValue(ByteBuffer data)

  - ### wrapValue

    public abstract ByteBuffer wrapValue(V value)

  - ### valueToString

    public String valueToString(Tlv<?,V> attribute)

  - ### sliceData

    protected final ByteBuffer sliceData(ByteBuffer bb, int length)
    Получения ByteBuffer содержащего data
    Parameters:
      `bb` -
      `length` -
    Returns:

  - ### readTypeLength

    public void readTypeLength(ByteBuffer bb, H header, int parentLength, boolean headerInLength)
    Считывание типа и длины. Обычно это производится родительской веткой, т.к. она знает какой размер у полей типа и длина.
    Частный случай родительской ветки - vendor
    Parameters:
      `bb` -
      `header` -
      `parentLength` -
      `headerInLength` -

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`