@Test public void testSerialize() throws Exception { Position thePosition = new Position(10, 20); Map<String, Object> theData = thePosition.serialize(); assertEquals(2, theData.size()); assertEquals("10.0", theData.get("x")); assertEquals("20.0", theData.get("y")); }
@Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put("x", Float.toString(x)); theResult.put("y", Float.toString(y)); return theResult; }
Position implements Reflectable<PositionClassInformation>, Distributable { @Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put("x", Float.toString(x)); theResult.put("y", Float.toString(y)); return theResult; } }
Position implements Reflectable<PositionClassInformation>, Distributable { @Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put("x", Float.toString(x)); theResult.put("y", Float.toString(y)); return theResult; } Position();  Position(float aX, float aY);  Position(double aX, double aY); }
Position implements Reflectable<PositionClassInformation>, Distributable { @Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put("x", Float.toString(x)); theResult.put("y", Float.toString(y)); return theResult; } Position();  Position(float aX, float aY);  Position(double aX, double aY); @Override boolean equals(Object o); @Override int hashCode(); @Override PositionClassInformation getClassInformation(); @ReflectiveMethod Position add(Position aOffset); @ReflectiveMethod Position changeX(Float aNewX); @ReflectiveMethod Position changeY(Float aNewY); @ReflectiveMethod Position snapToGrid(int aGridWidth, int aGridHeight); @Override Map<String, Object> serialize(); static Position deserialize(Map<String, Object> aSerializedStructure); Position translate(Angle aAngle, double aDistance); }
Position implements Reflectable<PositionClassInformation>, Distributable { @Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put("x", Float.toString(x)); theResult.put("y", Float.toString(y)); return theResult; } Position();  Position(float aX, float aY);  Position(double aX, double aY); @Override boolean equals(Object o); @Override int hashCode(); @Override PositionClassInformation getClassInformation(); @ReflectiveMethod Position add(Position aOffset); @ReflectiveMethod Position changeX(Float aNewX); @ReflectiveMethod Position changeY(Float aNewY); @ReflectiveMethod Position snapToGrid(int aGridWidth, int aGridHeight); @Override Map<String, Object> serialize(); static Position deserialize(Map<String, Object> aSerializedStructure); Position translate(Angle aAngle, double aDistance); @ReflectiveField
    final float x; @ReflectiveField
    final float y; }