PdxInstanceImpl extends PdxReaderImpl implements InternalPdxInstance { @Override public String toString() { StringBuilder result = new StringBuilder(); PdxReaderImpl ur = getUnmodifiableReader(); result.append("PDX[").append(ur.getPdxType().getTypeId()).append(",") .append(ur.getPdxType().getClassName()).append("]{"); boolean firstElement = true; for (PdxField fieldType : ur.getPdxType().getSortedIdentityFields()) { if (firstElement) { firstElement = false; } else { result.append(", "); } ; result.append(fieldType.getFieldName()); result.append("="); try { final Object value = ur.readField(fieldType.getFieldName()); if (value instanceof byte[]) { result.append(Hex.toHex((byte[]) value)); } else if (value.getClass().isArray()) { if (value instanceof short[]) { result.append(Arrays.toString((short[]) value)); } else if (value instanceof int[]) { result.append(Arrays.toString((int[]) value)); } else if (value instanceof long[]) { result.append(Arrays.toString((long[]) value)); } else if (value instanceof char[]) { result.append(Arrays.toString((char[]) value)); } else if (value instanceof float[]) { result.append(Arrays.toString((float[]) value)); } else if (value instanceof double[]) { result.append(Arrays.toString((double[]) value)); } else if (value instanceof boolean[]) { result.append(Arrays.toString((boolean[]) value)); } else { result.append(Arrays.deepToString((Object[]) value)); } } else { result.append(value); } } catch (RuntimeException e) { result.append(e); } } result.append("}"); return result.toString(); } PdxInstanceImpl(PdxType pdxType, DataInput in, int len); protected  PdxInstanceImpl(PdxReaderImpl original); static boolean getPdxReadSerialized(); static void setPdxReadSerialized(boolean readSerialized); @Override Object getField(String fieldName); @Override void sendTo(DataOutput out); @Override byte[] toBytes(); @Override Object getCachedObject(); @Override Object getObject(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @Override List<String> getFieldNames(); @Override WritablePdxInstance createWriter(); @Override synchronized String readString(String fieldName); @Override synchronized Object readObject(String fieldName); @Override synchronized Object readObject(PdxField ft); @Override synchronized char[] readCharArray(String fieldName); @Override synchronized boolean[] readBooleanArray(String fieldName); @Override synchronized byte[] readByteArray(String fieldName); @Override synchronized short[] readShortArray(String fieldName); @Override synchronized int[] readIntArray(String fieldName); @Override synchronized long[] readLongArray(String fieldName); @Override synchronized float[] readFloatArray(String fieldName); @Override synchronized double[] readDoubleArray(String fieldName); @Override synchronized String[] readStringArray(String fieldName); @Override synchronized Object[] readObjectArray(String fieldName); @Override synchronized Object[] readObjectArray(PdxField ft); @Override synchronized byte[][] readArrayOfByteArrays(String fieldName); @Override synchronized Object readField(String fieldName); @Override String getClassName(); @Override boolean isEnum(); @Override Object getRawField(String fieldName); @Override boolean isDeserializable();  }
@Test public void testToString() { assertEquals( pdxType.getClassName() + "]{" + booleanArrayField.getFieldName() + "=[false, true]" + ", " + booleanField.getFieldName() + "=true" + ", " + byteArrayField.getFieldName() + "=DEADBEEF" + ", " + charArrayField.getFieldName() + "=[o, k]" + ", " + doubleArrayField.getFieldName() + "=[3.14159, 2.71828]" + ", " + doubleField.getFieldName() + "=3.1415" + ", " + floatArrayField.getFieldName() + "=[3.14159, 2.71828]" + ", " + intArrayField.getFieldName() + "=[37, 42]" + ", " + intField.getFieldName() + "=37" + ", " + integerArrayField.getFieldName() + "=[37, 42]" + ", " + longArrayField.getFieldName() + "=[37, 42]" + ", " + longField.getFieldName() + "=42" + ", " + objectArrayField.getFieldName() + "=[Dave, Stewart]" + ", " + objectField.getFieldName() + "=Dave" + ", " + shortArrayField.getFieldName() + "=[37, 42]" + ", " + stringField.getFieldName() + "=MOOF!" + "}", substringAfter(instance.toString(), ",")); }