@Test public void jsonDeserialization() { String value = "{\"id\":0,\"leftSpeed\":5,\"rightSpeed\":-4,\"lights\":true,\"servos\":true,\"timestamp\":10,\"unsupported-field\": 'abc', \"panServoAngle\":42,\"tiltServoAngle\":10, \"takePicture\":false}"; assertThat(ControlMessage.fromJson(value), is(controlMessage)); }
public static ControlMessage fromJson(String json) { return new Gson().fromJson(json, ControlMessage.class); }
ControlMessage { public static ControlMessage fromJson(String json) { return new Gson().fromJson(json, ControlMessage.class); } }
ControlMessage { public static ControlMessage fromJson(String json) { return new Gson().fromJson(json, ControlMessage.class); } ControlMessage(int leftSpeed, int rightSpeed,
			boolean lights, int panServoAngle, int tiltServoAngle,
			boolean takePicture, boolean servos, boolean rawValues); }
ControlMessage { public static ControlMessage fromJson(String json) { return new Gson().fromJson(json, ControlMessage.class); } ControlMessage(int leftSpeed, int rightSpeed,
			boolean lights, int panServoAngle, int tiltServoAngle,
			boolean takePicture, boolean servos, boolean rawValues); static int[] getSpeedPowerMap(); static ControlMessage fromJson(String json); byte[] toSerialMessage(); long getTimestamp(); @Override String toString(); String toJson(); int getId(); boolean isServos(); boolean isLights(); boolean isRawValues(); int getLeftSpeed(); int getRightSpeed(); int getPanServoAngle(); int getTiltServoAngle(); @Override boolean equals(Object obj); @Override int hashCode(); void setTimestamp(long timestamp); }
ControlMessage { public static ControlMessage fromJson(String json) { return new Gson().fromJson(json, ControlMessage.class); } ControlMessage(int leftSpeed, int rightSpeed,
			boolean lights, int panServoAngle, int tiltServoAngle,
			boolean takePicture, boolean servos, boolean rawValues); static int[] getSpeedPowerMap(); static ControlMessage fromJson(String json); byte[] toSerialMessage(); long getTimestamp(); @Override String toString(); String toJson(); int getId(); boolean isServos(); boolean isLights(); boolean isRawValues(); int getLeftSpeed(); int getRightSpeed(); int getPanServoAngle(); int getTiltServoAngle(); @Override boolean equals(Object obj); @Override int hashCode(); void setTimestamp(long timestamp); static final int SPEED_STEPS; }