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:
java.lang.Iterable<I>
- Direct Known Subclasses:
RadiusAttributeInfo
public abstract class TlvInfo<I extends TlvInfo<I,?,H>,V,H extends TlvHeader>
extends java.lang.Object
implements java.lang.Iterable<I>
-
Field Summary
Fields Modifier and Type Field Description protected I[]childrenprotected java.util.List<I>childrenListprotected java.util.Map<java.lang.Integer,I>childrenMapjava.lang.Stringnameprotected java.util.Map<java.lang.String,I>nameChildrenMapprotected intparamLengthLengthprotected intparamTypeLengthprotected Iparentinttypestatic intTYPE_ABINARYstatic intTYPE_BYTEstatic intTYPE_DOUBLEstatic intTYPE_FLOATstatic intTYPE_INTEGERstatic intTYPE_IPADDRstatic intTYPE_IPV6ADDRstatic intTYPE_IPV6PREFIXstatic intTYPE_LONGstatic intTYPE_OCTETSstatic intTYPE_SHORTstatic intTYPE_STRINGstatic intTYPE_TLVintvalueType -
Constructor Summary
-
Method Summary
Modifier and Type Method Description IgetChild(int type)IgetChild(java.lang.String name)java.util.Iterator<I>iterator()abstract Tlv<?,?>read(java.nio.ByteBuffer bb, H header)voidreadTypeLength(java.nio.ByteBuffer bb, H header, int parentLength, boolean headerInLength)Считывание типа и длины.voidsetParent(I parent)protected java.nio.ByteBuffersliceData(java.nio.ByteBuffer bb, int length)Получения ByteBuffer содержащего dataabstract VunwrapValue(java.nio.ByteBuffer data)java.lang.StringvalueToString(Tlv<?,V> attribute)abstract java.nio.ByteBufferwrapValue(V value)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 java.lang.String name -
valueType
public final int valueType -
parent
-
childrenList
-
children
-
childrenMap
-
nameChildrenMap
-
-
Constructor Details
-
TlvInfo
public TlvInfo(java.lang.Class<?> clazz, int type, java.lang.String name, int valueType, int paramTypeSize, int paramLengthSize, java.util.List<I> children)
-
-
Method Details
-
setParent
-
getChild
-
getChild
-
iterator
-
read
-
unwrapValue
-
wrapValue
-
valueToString
-
sliceData
protected final java.nio.ByteBuffer sliceData(java.nio.ByteBuffer bb, int length)Получения ByteBuffer содержащего data- Parameters:
bb-length-- Returns:
-
readTypeLength
public void readTypeLength(java.nio.ByteBuffer bb, H header, int parentLength, boolean headerInLength)Считывание типа и длины. Обычно это производится родительской веткой, т.к. она знает какой размер у полей типа и длина. Частный случай родительской ветки - vendor- Parameters:
bb-header-parentLength-headerInLength-
-