@Test public void testDeserialize() throws Exception { Map<String, Object> theData = new HashMap<>(); theData.put("r", "10"); theData.put("g", "20"); theData.put("b", "30"); Color theColor = Color.deserialize(theData); assertEquals(10, theColor.r); assertEquals(20, theColor.g); assertEquals(30, theColor.b); }
public static Color deserialize(Map<String, Object> aSerializedData) { int theR = Integer.parseInt((String) aSerializedData.get("r")); int theG = Integer.parseInt((String) aSerializedData.get("g")); int theB = Integer.parseInt((String) aSerializedData.get("b")); return new Color(theR, theG, theB); }
Color implements Reflectable<ColorClassInformation>, Distributable { public static Color deserialize(Map<String, Object> aSerializedData) { int theR = Integer.parseInt((String) aSerializedData.get("r")); int theG = Integer.parseInt((String) aSerializedData.get("g")); int theB = Integer.parseInt((String) aSerializedData.get("b")); return new Color(theR, theG, theB); } }
Color implements Reflectable<ColorClassInformation>, Distributable { public static Color deserialize(Map<String, Object> aSerializedData) { int theR = Integer.parseInt((String) aSerializedData.get("r")); int theG = Integer.parseInt((String) aSerializedData.get("g")); int theB = Integer.parseInt((String) aSerializedData.get("b")); return new Color(theR, theG, theB); } Color(int aR, int aG, int aB); }
Color implements Reflectable<ColorClassInformation>, Distributable { public static Color deserialize(Map<String, Object> aSerializedData) { int theR = Integer.parseInt((String) aSerializedData.get("r")); int theG = Integer.parseInt((String) aSerializedData.get("g")); int theB = Integer.parseInt((String) aSerializedData.get("b")); return new Color(theR, theG, theB); } Color(int aR, int aG, int aB); @Override boolean equals(Object o); @Override int hashCode(); @Override ColorClassInformation getClassInformation(); @Override Map<String, Object> serialize(); static Color deserialize(Map<String, Object> aSerializedData); }
Color implements Reflectable<ColorClassInformation>, Distributable { public static Color deserialize(Map<String, Object> aSerializedData) { int theR = Integer.parseInt((String) aSerializedData.get("r")); int theG = Integer.parseInt((String) aSerializedData.get("g")); int theB = Integer.parseInt((String) aSerializedData.get("b")); return new Color(theR, theG, theB); } Color(int aR, int aG, int aB); @Override boolean equals(Object o); @Override int hashCode(); @Override ColorClassInformation getClassInformation(); @Override Map<String, Object> serialize(); static Color deserialize(Map<String, Object> aSerializedData); static final Color WHITE; static final Color BLACK; static final Color RED; static final Color YELLOW; @ReflectiveField
    final int r; @ReflectiveField
    final int g; @ReflectiveField
    final int b; }