Package org.aion.rlp

Class Value


  • public class Value
    extends Object
    Class to encapsulate an object and provide utilities for conversion
    Author:
    ethereumJ 2014, modified by aion 2017
    • Constructor Detail

      • Value

        public Value​(Object obj)
    • Method Detail

      • fromRlpEncoded

        public static Value fromRlpEncoded​(byte[] data)
      • asObj

        public Object asObj()
      • asInt

        public int asInt()
        Returns:
        the numerical value as an Integer. If called for values that are not integers or byte arrays it will return 0.
      • asLong

        public long asLong()
        Returns:
        the numerical value as a Long. If called for values that are not integers or byte arrays it will return 0.
      • asBigInt

        public BigInteger asBigInt()
        Returns:
        the numerical value as a BigInteger. If called for values that are not numbers or byte arrays it will return BigInteger.ZERO.
      • asString

        public String asString()
        ImplNote If called for values that are not strings or byte arrays it will return an empty string.
      • asBytes

        public byte[] asBytes()
        ImplNote If called for values that are not strings or byte arrays it will return an empty byte array.
      • getData

        public byte[] getData()
      • get

        public Value get​(int index)
      • encode

        public byte[] encode()
      • cmp

        public boolean cmp​(Value o)
      • isList

        public boolean isList()
      • isString

        public boolean isString()
      • isBytes

        public boolean isBytes()
      • isHashCode

        public boolean isHashCode()
      • isNull

        public boolean isNull()
      • length

        public int length()