TypedValue { public static TypedValue ofLocal(ColumnMetaData.Rep rep, Object value) { return new TypedValue(rep, localToSerial(rep, value)); } private  TypedValue(ColumnMetaData.Rep rep, Object value); @JsonCreator static TypedValue create(@JsonProperty("type") String type,
      @JsonProperty("value") Object value); static TypedValue ofLocal(ColumnMetaData.Rep rep, Object value); static TypedValue ofSerial(ColumnMetaData.Rep rep, Object value); static TypedValue ofJdbc(ColumnMetaData.Rep rep, Object value,
      Calendar calendar); static TypedValue ofJdbc(Object value, Calendar calendar); Object toLocal(); Object toJdbc(Calendar calendar); static List<Object> values(List<TypedValue> typedValues); Common.TypedValue toProto(); static TypedValue fromProto(Common.TypedValue proto); @Override int hashCode(); @Override boolean equals(Object o); static final TypedValue NULL; final ColumnMetaData.Rep type; final Object value; }
@Test public void testBoolean() { serializeAndEqualityCheck(TypedValue.ofLocal(Rep.PRIMITIVE_BOOLEAN, true)); serializeAndEqualityCheck(TypedValue.ofLocal(Rep.BOOLEAN, Boolean.TRUE)); }
@Test public void testByte() { serializeAndEqualityCheck(TypedValue.ofLocal(Rep.PRIMITIVE_BYTE, (byte) 4)); serializeAndEqualityCheck(TypedValue.ofLocal(Rep.BYTE, Byte.valueOf((byte) 4))); }
@Test public void testShort() { serializeAndEqualityCheck(TypedValue.ofLocal(Rep.PRIMITIVE_SHORT, (short) 42)); serializeAndEqualityCheck(TypedValue.ofLocal(Rep.SHORT, Short.valueOf((short) 42))); }
@Test public void testInteger() { serializeAndEqualityCheck(TypedValue.ofLocal(Rep.PRIMITIVE_INT, (int) 42000)); serializeAndEqualityCheck(TypedValue.ofLocal(Rep.INTEGER, Integer.valueOf((int) 42000))); }
@Test public void testLong() { serializeAndEqualityCheck(TypedValue.ofLocal(Rep.PRIMITIVE_LONG, Long.MAX_VALUE)); serializeAndEqualityCheck(TypedValue.ofLocal(Rep.LONG, Long.valueOf(Long.MAX_VALUE))); }
@Test public void testFloat() { serializeAndEqualityCheck(TypedValue.ofLocal(Rep.PRIMITIVE_FLOAT, 3.14159f)); serializeAndEqualityCheck(TypedValue.ofLocal(Rep.FLOAT, Float.valueOf(3.14159f))); }
@Test public void testDouble() { serializeAndEqualityCheck(TypedValue.ofLocal(Rep.PRIMITIVE_DOUBLE, Double.MAX_VALUE)); serializeAndEqualityCheck(TypedValue.ofLocal(Rep.DOUBLE, Double.valueOf(Double.MAX_VALUE))); }
@Test public void testChar() { serializeAndEqualityCheck(TypedValue.ofLocal(Rep.PRIMITIVE_CHAR, 'c')); serializeAndEqualityCheck(TypedValue.ofLocal(Rep.CHARACTER, Character.valueOf('c'))); }
@Test public void testString() { serializeAndEqualityCheck(TypedValue.ofLocal(Rep.STRING, "qwertyasdf")); }
@Test public void testByteString() { serializeAndEqualityCheck( TypedValue.ofLocal(Rep.BYTE_STRING, new ByteString("qwertyasdf".getBytes(StandardCharsets.UTF_8)))); }
@Test public void testSqlDate() { serializeAndEqualityCheck(TypedValue.ofLocal(Rep.JAVA_SQL_DATE, 25)); }
@Test public void testUtilDate() { serializeAndEqualityCheck( TypedValue.ofLocal(Rep.JAVA_UTIL_DATE, System.currentTimeMillis())); }
@Test public void testSqlTime() { serializeAndEqualityCheck( TypedValue.ofLocal(Rep.JAVA_SQL_TIME, 42 * 1024 * 1024)); }
@Test public void testSqlTimestamp() { serializeAndEqualityCheck( TypedValue.ofLocal(Rep.JAVA_SQL_TIMESTAMP, 42L * 1024 * 1024 * 1024)); }