@Test public void testSerialize() throws Exception { Angle theAngle = new Angle(10); Map<String, Object> theData = theAngle.serialize(); assertEquals(1, theData.size()); assertEquals("10", theData.get("angleindegrees")); }
@Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put("angleindegrees", Integer.toString(angleInDegrees)); return theResult; }
Angle implements Reflectable, Distributable { @Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put("angleindegrees", Integer.toString(angleInDegrees)); return theResult; } }
Angle implements Reflectable, Distributable { @Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put("angleindegrees", Integer.toString(angleInDegrees)); return theResult; } Angle(int aAngleInDegrees); }
Angle implements Reflectable, Distributable { @Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put("angleindegrees", Integer.toString(angleInDegrees)); return theResult; } Angle(int aAngleInDegrees); Integer get(); @ReflectiveMethod Angle add(int aDiff); @ReflectiveMethod Angle invert(); @ReflectiveMethod Angle snapTo(int aStep); @ReflectiveMethod Angle resetToZero(); float toRadians(); @Override boolean equals(Object o); @Override int hashCode(); @Override AngleClassInformation getClassInformation(); @Override Map<String, Object> serialize(); static Angle deserialize(Map<String, Object> aSerializedData); static Angle fromRadians(float aAngleInRadians); }
Angle implements Reflectable, Distributable { @Override public Map<String, Object> serialize() { Map<String, Object> theResult = new HashMap<>(); theResult.put("angleindegrees", Integer.toString(angleInDegrees)); return theResult; } Angle(int aAngleInDegrees); Integer get(); @ReflectiveMethod Angle add(int aDiff); @ReflectiveMethod Angle invert(); @ReflectiveMethod Angle snapTo(int aStep); @ReflectiveMethod Angle resetToZero(); float toRadians(); @Override boolean equals(Object o); @Override int hashCode(); @Override AngleClassInformation getClassInformation(); @Override Map<String, Object> serialize(); static Angle deserialize(Map<String, Object> aSerializedData); static Angle fromRadians(float aAngleInRadians); final int angleInDegrees; static final Angle ZERO; }