@Test void testAsBytes() { assertThrows(RpcValueException.class, plainStringValue::asByteArray); assertArrayEquals(new byte[]{1, 2, 3, 4, 5}, bytesValue.asByteArray()); assertThrows(RpcValueException.class, oddIntegerValue::asByteArray); assertArrayEquals(new byte[]{-15, 35}, evenIntegerValue.asByteArray()); assertThrows(RpcValueException.class, booleanValue::asByteArray); }
@Override public Bytes asBytes() { return new Bytes(value); }
RpcValue implements RpcItem { @Override public Bytes asBytes() { return new Bytes(value); } }
RpcValue implements RpcItem { @Override public Bytes asBytes() { return new Bytes(value); } RpcValue(RpcValue value);  RpcValue(Address value); private  RpcValue();  RpcValue(String value);  RpcValue(byte[] value);  RpcValue(BigInteger value);  RpcValue(boolean value);  RpcValue(Boolean value);  RpcValue(Bytes value); }
RpcValue implements RpcItem { @Override public Bytes asBytes() { return new Bytes(value); } RpcValue(RpcValue value);  RpcValue(Address value); private  RpcValue();  RpcValue(String value);  RpcValue(byte[] value);  RpcValue(BigInteger value);  RpcValue(boolean value);  RpcValue(Boolean value);  RpcValue(Bytes value); @Override boolean isEmpty(); @Override boolean isNull(); @Override String asString(); @Override byte[] asByteArray(); @Override Address asAddress(); @Override Bytes asBytes(); @Override BigInteger asInteger(); @Override Boolean asBoolean(); @Override String toString(); }
RpcValue implements RpcItem { @Override public Bytes asBytes() { return new Bytes(value); } RpcValue(RpcValue value);  RpcValue(Address value); private  RpcValue();  RpcValue(String value);  RpcValue(byte[] value);  RpcValue(BigInteger value);  RpcValue(boolean value);  RpcValue(Boolean value);  RpcValue(Bytes value); @Override boolean isEmpty(); @Override boolean isNull(); @Override String asString(); @Override byte[] asByteArray(); @Override Address asAddress(); @Override Bytes asBytes(); @Override BigInteger asInteger(); @Override Boolean asBoolean(); @Override String toString(); final static RpcValue NULL; }