@Test public void testBoolDecode() { assertThat(TypeDecoder.decodeBool( "0000000000000000000000000000000000000000000000000000000000000000", 0), CoreMatchers.is(new Bool(false))); assertThat(TypeDecoder.decodeBool( "0000000000000000000000000000000000000000000000000000000000000001", 0), is(new Bool(true))); }
static Bool decodeBool(String rawInput, int offset) { String input = rawInput.substring(offset, offset + MAX_BYTE_LENGTH_FOR_HEX_STRING); BigInteger numericValue = Numeric.toBigInt(input); boolean value = numericValue.equals(BigInteger.ONE); return new Bool(value); }
TypeDecoder { static Bool decodeBool(String rawInput, int offset) { String input = rawInput.substring(offset, offset + MAX_BYTE_LENGTH_FOR_HEX_STRING); BigInteger numericValue = Numeric.toBigInt(input); boolean value = numericValue.equals(BigInteger.ONE); return new Bool(value); } }
TypeDecoder { static Bool decodeBool(String rawInput, int offset) { String input = rawInput.substring(offset, offset + MAX_BYTE_LENGTH_FOR_HEX_STRING); BigInteger numericValue = Numeric.toBigInt(input); boolean value = numericValue.equals(BigInteger.ONE); return new Bool(value); }  }
TypeDecoder { static Bool decodeBool(String rawInput, int offset) { String input = rawInput.substring(offset, offset + MAX_BYTE_LENGTH_FOR_HEX_STRING); BigInteger numericValue = Numeric.toBigInt(input); boolean value = numericValue.equals(BigInteger.ONE); return new Bool(value); }  static T decode(
            String input, int offset, TypeReference<T> typeReference); }
TypeDecoder { static Bool decodeBool(String rawInput, int offset) { String input = rawInput.substring(offset, offset + MAX_BYTE_LENGTH_FOR_HEX_STRING); BigInteger numericValue = Numeric.toBigInt(input); boolean value = numericValue.equals(BigInteger.ONE); return new Bool(value); }  static T decode(
            String input, int offset, TypeReference<T> typeReference);  }