@Test public void testUintEncode() { Uint zero = new Uint64(BigInteger.ZERO); assertThat(PlatOnTypeEncoder.encode(zero), is("0000000000000000")); Uint maxLong = new Uint64(BigInteger.valueOf(Long.MAX_VALUE)); assertThat(PlatOnTypeEncoder.encode(maxLong), is("7fffffffffffffff")); }
@SuppressWarnings("unchecked") public static String encode(Type parameter) { if (parameter instanceof IntType) { return encodeInt((IntType) parameter); } else if (parameter instanceof Utf8String) { return encodeString((Utf8String) parameter); } else { throw new UnsupportedOperationException( "Type cannot be encoded: " + parameter.getClass()); } }
PlatOnTypeEncoder { @SuppressWarnings("unchecked") public static String encode(Type parameter) { if (parameter instanceof IntType) { return encodeInt((IntType) parameter); } else if (parameter instanceof Utf8String) { return encodeString((Utf8String) parameter); } else { throw new UnsupportedOperationException( "Type cannot be encoded: " + parameter.getClass()); } } }
PlatOnTypeEncoder { @SuppressWarnings("unchecked") public static String encode(Type parameter) { if (parameter instanceof IntType) { return encodeInt((IntType) parameter); } else if (parameter instanceof Utf8String) { return encodeString((Utf8String) parameter); } else { throw new UnsupportedOperationException( "Type cannot be encoded: " + parameter.getClass()); } } private  PlatOnTypeEncoder(); }
PlatOnTypeEncoder { @SuppressWarnings("unchecked") public static String encode(Type parameter) { if (parameter instanceof IntType) { return encodeInt((IntType) parameter); } else if (parameter instanceof Utf8String) { return encodeString((Utf8String) parameter); } else { throw new UnsupportedOperationException( "Type cannot be encoded: " + parameter.getClass()); } } private  PlatOnTypeEncoder(); @SuppressWarnings("unchecked") static String encode(Type parameter); }
PlatOnTypeEncoder { @SuppressWarnings("unchecked") public static String encode(Type parameter) { if (parameter instanceof IntType) { return encodeInt((IntType) parameter); } else if (parameter instanceof Utf8String) { return encodeString((Utf8String) parameter); } else { throw new UnsupportedOperationException( "Type cannot be encoded: " + parameter.getClass()); } } private  PlatOnTypeEncoder(); @SuppressWarnings("unchecked") static String encode(Type parameter);  }