@Test public void testBoolEncode() { assertThat(TypeEncoder.encodeBool(new Bool(false)), is("0000000000000000000000000000000000000000000000000000000000000000")); assertThat(TypeEncoder.encodeBool(new Bool(true)), is("0000000000000000000000000000000000000000000000000000000000000001")); }
static String encodeBool(Bool value) { byte[] rawValue = new byte[Type.MAX_BYTE_LENGTH]; if (value.getValue()) { rawValue[rawValue.length - 1] = 1; } return Numeric.toHexStringNoPrefix(rawValue); }
TypeEncoder { static String encodeBool(Bool value) { byte[] rawValue = new byte[Type.MAX_BYTE_LENGTH]; if (value.getValue()) { rawValue[rawValue.length - 1] = 1; } return Numeric.toHexStringNoPrefix(rawValue); } }
TypeEncoder { static String encodeBool(Bool value) { byte[] rawValue = new byte[Type.MAX_BYTE_LENGTH]; if (value.getValue()) { rawValue[rawValue.length - 1] = 1; } return Numeric.toHexStringNoPrefix(rawValue); } private  TypeEncoder(); }
TypeEncoder { static String encodeBool(Bool value) { byte[] rawValue = new byte[Type.MAX_BYTE_LENGTH]; if (value.getValue()) { rawValue[rawValue.length - 1] = 1; } return Numeric.toHexStringNoPrefix(rawValue); } private  TypeEncoder(); @SuppressWarnings("unchecked") static String encode(Type parameter); }
TypeEncoder { static String encodeBool(Bool value) { byte[] rawValue = new byte[Type.MAX_BYTE_LENGTH]; if (value.getValue()) { rawValue[rawValue.length - 1] = 1; } return Numeric.toHexStringNoPrefix(rawValue); } private  TypeEncoder(); @SuppressWarnings("unchecked") static String encode(Type parameter);  }