TypeCodes { public static String encode(int propertyType, String propertyName) { String typeCode = checkNotNull(TYPE2CODE.get(propertyType)); return typeCode + ':' + propertyName; } private  TypeCodes(); static String encode(int propertyType, String propertyName); static int split(String jsonString); static int decodeType(int split, String jsonString); static String decodeName(int split, String jsonString); static final String EMPTY_ARRAY; }
@Test public void testEncode() { assertEquals("str:foo", TypeCodes.encode(PropertyType.STRING, "foo")); assertEquals(":blobId:", TypeCodes.encode(PropertyType.BINARY, "")); assertEquals("und:foo", TypeCodes.encode(PropertyType.UNDEFINED, "foo")); }