Skip to content

Instantly share code, notes, and snippets.

@mbeauv
Created February 14, 2018 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbeauv/34c5cd2cbdccb53f200fff40a6d64867 to your computer and use it in GitHub Desktop.
Save mbeauv/34c5cd2cbdccb53f200fff40a6d64867 to your computer and use it in GitHub Desktop.
Example of Urbanoe POJO
package com.teleronsoftware.urbanoe.client.model;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
import java.io.Serializable;
import java.util.Date;
/**
* Represents a issue in the system. Note that this structure should only be
* created on the server. On the mobile, it should only be marshalled.
*/
@SuppressWarnings("serial")
@JsonSerialize(include = Inclusion.NON_NULL)
public class Issue implements Serializable {
@JsonIgnore
private Long localId;
@JsonProperty("id")
private Long remoteId;
@JsonProperty("street")
private String street;
@JsonProperty
private Double longitude;
@JsonProperty
private Double latitude;
@JsonProperty
private Double accuracy;
@JsonProperty
private Double bearing;
@JsonProperty
private Double altitude;
@JsonProperty("overview_description")
private String overviewDescription;
@JsonProperty("issue_type_cd")
private IssueType issueType;
@JsonProperty("property_type_cd")
private PropertyType propertyType;
@JsonProperty("hazard_level_cd")
private HazardLevelType hazardLevel;
@JsonProperty("pet_type_cd")
private PetType petType;
@JsonProperty("size_cd")
private IssueSize size;
@JsonProperty("created_at")
private Date createdAt;
@JsonProperty("updated_at")
private Date updatedAt;
@JsonProperty("owner_id")
private Long ownerId;
@JsonProperty("city_id")
private Long cityId;
@JsonProperty("location_description")
private String locationDescription;
@JsonProperty("closed")
private Boolean closed;
@JsonProperty("close_reason_cd")
private IssueCloseReasonType closeReason;
@JsonProperty("master_image_thumb_url")
private String masterImageThumbUrl;
@JsonProperty("owner_nickname")
private String ownerNickname;
@JsonProperty("rating_total")
private Long ratingTotal;
@JsonProperty("rating_average")
private Float ratingAverage;
@JsonProperty("rating_vote_count")
private Long ratingVoteCount;
@JsonProperty("rating_rank")
private Long ratingRank;
@JsonProperty("comment_count")
private Long commentCount;
public Issue() {
}
public Issue(Long remoteId, IssueType issueType, IssueSize size, PropertyType propertyType,
HazardLevelType hazardLevel, String street, Double longitude, Double latitude,
Double accuracy, Double bearing, Double altitude, Boolean closed,
String masterImageThumbUrl, Float ratingAverage, Long ratingVoteCount,
Long ratingRank, Long ratingTotal, Long commentCount) {
this.remoteId = remoteId;
this.issueType = issueType;
this.size = size;
this.propertyType = propertyType;
this.hazardLevel = hazardLevel;
this.street = street;
this.longitude = longitude;
this.latitude = latitude;
this.accuracy = accuracy;
this.bearing = bearing;
this.altitude = altitude;
this.closed = closed;
this.masterImageThumbUrl = masterImageThumbUrl;
this.ratingTotal = ratingTotal;
this.ratingAverage = ratingAverage;
this.ratingVoteCount = ratingVoteCount;
this.ratingRank = ratingRank;
this.commentCount = commentCount;
}
@JsonSerialize(using = com.teleronsoftware.urbanoe.client.serializers.IssueTypeSerializer.class)
public IssueType getIssueType() {
return issueType;
}
@JsonDeserialize(using = com.teleronsoftware.urbanoe.client.serializers.IssueTypeDeserializer.class)
public void setIssueType(IssueType issueType) {
this.issueType = issueType;
}
@JsonSerialize(using = com.teleronsoftware.urbanoe.client.serializers.PetTypeSerializer.class)
public PetType getPetType() {
return petType;
}
@JsonDeserialize(using = com.teleronsoftware.urbanoe.client.serializers.PetTypeDeserializer.class)
public void setPetType(PetType petType) {
this.petType = petType;
}
@JsonSerialize(using = com.teleronsoftware.urbanoe.client.serializers.PropertyTypeSerializer.class)
public PropertyType getPropertyType() {
return propertyType;
}
@JsonDeserialize(using = com.teleronsoftware.urbanoe.client.serializers.PropertyTypeDeserializer.class)
public void setPropertyType(PropertyType propertyType) {
this.propertyType = propertyType;
}
@JsonSerialize(using = com.teleronsoftware.urbanoe.client.serializers.IssueSizeSerializer.class)
public IssueSize getSize() {
return size;
}
@JsonDeserialize(using = com.teleronsoftware.urbanoe.client.serializers.IssueSizeDeserializer.class)
public void setSize(IssueSize size) {
this.size = size;
}
@JsonSerialize(using = com.teleronsoftware.urbanoe.client.serializers.HazardLevelTypeSerializer.class)
public HazardLevelType getHazardLevel() {
return hazardLevel;
}
@JsonDeserialize(using = com.teleronsoftware.urbanoe.client.serializers.HazardLevelTypeDeserializer.class)
public void setHazardLevel(HazardLevelType hazardLevel) {
this.hazardLevel = hazardLevel;
}
@JsonSerialize(using = com.teleronsoftware.urbanoe.client.serializers.RailsDateSerializer.class)
public Date getCreatedAt() {
return createdAt;
}
@JsonDeserialize(using = com.teleronsoftware.urbanoe.client.serializers.RailsDateDeserializer.class)
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
@JsonSerialize(using = com.teleronsoftware.urbanoe.client.serializers.IssueCloseReasonTypeSerializer.class)
public IssueCloseReasonType getCloseReason() {
return closeReason;
}
@JsonDeserialize(using = com.teleronsoftware.urbanoe.client.serializers.IssueCloseReasonTypeDeserializer.class)
public void setCloseReason(IssueCloseReasonType closeReason) {
this.closeReason = closeReason;
}
public Long getLocalId() {
return localId;
}
public void setLocalId(Long localId) {
this.localId = localId;
}
public Long getRemoteId() {
return remoteId;
}
public void setRemoteId(Long id) {
this.remoteId = id;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Double getAccuracy() {
return accuracy;
}
public void setAccuracy(Double accuracy) {
this.accuracy = accuracy;
}
public Double getBearing() {
return bearing;
}
public void setBearing(Double bearing) {
this.bearing = bearing;
}
public Double getAltitude() {
return altitude;
}
public void setAltitude(Double altitude) {
this.altitude = altitude;
}
public Long getOwnerId() {
return ownerId;
}
public void setOwnerId(Long ownerId) {
this.ownerId = ownerId;
}
@JsonSerialize(using = com.teleronsoftware.urbanoe.client.serializers.RailsDateSerializer.class)
public Date getUpdatedAt() {
return updatedAt;
}
@JsonDeserialize(using = com.teleronsoftware.urbanoe.client.serializers.RailsDateDeserializer.class)
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Long getCityId() {
return cityId;
}
public void setCityId(Long cityId) {
this.cityId = cityId;
}
public String getLocationDescription() {
return locationDescription;
}
public void setLocationDescription(String locationDescription) {
this.locationDescription = locationDescription;
}
public String getOverviewDescription() {
return overviewDescription;
}
public void setOverviewDescription(String overviewDescription) {
this.overviewDescription = overviewDescription;
}
public Boolean getClosed() {
return closed;
}
public void setClosed(Boolean closed) {
this.closed = closed;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getMasterImageThumbUrl() {
return masterImageThumbUrl;
}
public void setMasterImageThumbUrl(String masterImageThumbUrl) {
this.masterImageThumbUrl = masterImageThumbUrl;
}
public String getOwnerNickname() {
return ownerNickname;
}
public void setOwnerNickname(String ownerNickname) {
this.ownerNickname = ownerNickname;
}
public Float getRatingAverage() {
return ratingAverage;
}
public void setRatingAverage(Float ratingAverage) {
this.ratingAverage = ratingAverage;
}
public Long getRatingVoteCount() {
return ratingVoteCount;
}
public void setRatingVoteCount(Long ratingVoteCount) {
this.ratingVoteCount = ratingVoteCount;
}
public Long getRatingRank() {
return ratingRank;
}
public void setRatingRank(Long ratingRank) {
this.ratingRank = ratingRank;
}
public Long getRatingTotal() {
return ratingTotal;
}
public void setRatingTotal(Long ratingTotal) {
this.ratingTotal = ratingTotal;
}
public Long getCommentCount() {
return commentCount;
}
public void setCommentCount(Long commentCount) {
this.commentCount = commentCount;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment