You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you add support for SerializedName? This way we can assign field names different than the variable name. Example:
public class Pose {
Camera camera;
Anchor anchor;
@SerializedName(value = "recording-id")
int recordingId;
Bbox bbox;
@SerializedName(value = "track-id")
int trackId;
public Pose(Camera camera, Anchor anchor, int recordingId, Bbox bbox, int trackId) {
this.camera = camera;
this.anchor = anchor;
this.recordingId = recordingId;
this.bbox = bbox;
this.trackId = trackId;
}
public void setBbox(Bbox bbox) {
this.bbox = bbox;
}
}
pose = new com.memex.gson.Pose(cameraJson, anchorJson, recordingId, bbox, trackId);
new TomlWriter().write(pose, poseFile);
This is incorrectly serialized as:
recordingId = -1
trackId = 0
[anchor]
latitude = 44.4259019
longitude = 8.8628793
name = "42850a73-9fbd-4ba5-a0e3-2e04644f24c1"
[anchor.orientation]
w = 0.9143955
x = 0.0
y = 0.40482244
z = 0.0
[anchor.translation]
x = -0.8728261
y = -0.30460373
z = -0.37339234
[bbox]
x1 = 360
x2 = 454
y1 = 293
y2 = 183
[camera.orientation]
w = -0.63340276
x = 0.06788388
y = 0.31760123
z = 0.702369
[camera.translation]
x = 0.11091955
y = -0.0041119093
z = -0.06686936
recordingId should be recording-id and trackId should be track-id
The text was updated successfully, but these errors were encountered:
Can you add support for SerializedName? This way we can assign field names different than the variable name. Example:
This is incorrectly serialized as:
recordingId should be recording-id and trackId should be track-id
The text was updated successfully, but these errors were encountered: