Class TLVMsg

java.lang.Object
org.jpos.tlv.TLVMsg
All Implemented Interfaces:
Loggeable

public class TLVMsg extends Object implements Loggeable
  • Constructor Details

    • TLVMsg

      @Deprecated public TLVMsg(int tag, byte[] value) throws IllegalArgumentException
      Deprecated.
      In most cases, a message is created to attach it to the list.
      It can be done by:
        TLVList tl = ...;
        tl.append(tag, value);
      
      If for some reason this is not possible then a message can be created:
        TLVList tl = TLVListBuilder.createInstance().build(); // or just new TLVList();
        tl.append(tag, value);
        TLVMsg tm = tl.find(tag);
      
      The intention is to not promote the use of TLVMsg outside. Due to the lack of compatibility of various TLV types at TLVList.append(TLVMsg)
      Constructs a TLV message from tag and value.
      Parameters:
      tag - id
      value - tag value
      Throws:
      IllegalArgumentException
    • TLVMsg

      protected TLVMsg(int tag, byte[] value, int tagSize, int lengthSize) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
  • Method Details

    • getTag

      public int getTag()
      Returns:
      tag
    • getValue

      public byte[] getValue()
      Returns:
      tag value
    • getTLV

      public byte[] getTLV()
      Returns:
      tag + length + value of the TLV Message
    • getL

      public byte[] getL()
      Value up to 127 can be encoded in single byte and multiple bytes are required for length bigger than 127
      Returns:
      encoded length
    • getStringValue

      Returns:
      value
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • dump

      public void dump(PrintStream p, String indent)
      Specified by:
      dump in interface Loggeable