@Test public void decode_boolean() { final Bytes data = Bytes.fromHexString("0x01"); final Boolean decoded = SimpleOffsetSerializer.deserialize(data, boolean.class); assertThat(decoded).isTrue(); }
public static <T> T deserialize(Bytes bytes, Class<T> classInfo) { MutableInt bytePointer = new MutableInt(0); if (!isPrimitive(classInfo)) { return SSZ.decode( bytes, reader -> { final T result = deserializeContainerErrorWrapper(classInfo, reader, bytePointer, bytes.size()); assertAllDataRead(reader); return result; }); } else { return SSZ.decode( bytes, reader -> { final T result = (T) deserializePrimitive(classInfo, reader, bytePointer); assertAllDataRead(reader); return result; }); } }
SimpleOffsetSerializer { public static <T> T deserialize(Bytes bytes, Class<T> classInfo) { MutableInt bytePointer = new MutableInt(0); if (!isPrimitive(classInfo)) { return SSZ.decode( bytes, reader -> { final T result = deserializeContainerErrorWrapper(classInfo, reader, bytePointer, bytes.size()); assertAllDataRead(reader); return result; }); } else { return SSZ.decode( bytes, reader -> { final T result = (T) deserializePrimitive(classInfo, reader, bytePointer); assertAllDataRead(reader); return result; }); } } }
SimpleOffsetSerializer { public static <T> T deserialize(Bytes bytes, Class<T> classInfo) { MutableInt bytePointer = new MutableInt(0); if (!isPrimitive(classInfo)) { return SSZ.decode( bytes, reader -> { final T result = deserializeContainerErrorWrapper(classInfo, reader, bytePointer, bytes.size()); assertAllDataRead(reader); return result; }); } else { return SSZ.decode( bytes, reader -> { final T result = (T) deserializePrimitive(classInfo, reader, bytePointer); assertAllDataRead(reader); return result; }); } }  }
SimpleOffsetSerializer { public static <T> T deserialize(Bytes bytes, Class<T> classInfo) { MutableInt bytePointer = new MutableInt(0); if (!isPrimitive(classInfo)) { return SSZ.decode( bytes, reader -> { final T result = deserializeContainerErrorWrapper(classInfo, reader, bytePointer, bytes.size()); assertAllDataRead(reader); return result; }); } else { return SSZ.decode( bytes, reader -> { final T result = (T) deserializePrimitive(classInfo, reader, bytePointer); assertAllDataRead(reader); return result; }); } }  static void setConstants(); static Bytes serialize(SimpleOffsetSerializable value); static Bytes serializeFixedCompositeList(
      SSZList<? extends SimpleOffsetSerializable> values); static Bytes serializeVariableCompositeList(
      SSZList<? extends SimpleOffsetSerializable> values); static T deserialize(Bytes bytes, Class<T> classInfo); static Optional<LengthBounds> getLengthBounds(final Class<T> type); }
SimpleOffsetSerializer { public static <T> T deserialize(Bytes bytes, Class<T> classInfo) { MutableInt bytePointer = new MutableInt(0); if (!isPrimitive(classInfo)) { return SSZ.decode( bytes, reader -> { final T result = deserializeContainerErrorWrapper(classInfo, reader, bytePointer, bytes.size()); assertAllDataRead(reader); return result; }); } else { return SSZ.decode( bytes, reader -> { final T result = (T) deserializePrimitive(classInfo, reader, bytePointer); assertAllDataRead(reader); return result; }); } }  static void setConstants(); static Bytes serialize(SimpleOffsetSerializable value); static Bytes serializeFixedCompositeList(
      SSZList<? extends SimpleOffsetSerializable> values); static Bytes serializeVariableCompositeList(
      SSZList<? extends SimpleOffsetSerializable> values); static T deserialize(Bytes bytes, Class<T> classInfo); static Optional<LengthBounds> getLengthBounds(final Class<T> type); static HashMap<Class, ReflectionInformation> classReflectionInfo; static HashMap<Class, LengthBounds> classLengthBounds; }