Created
June 5, 2014 16:21
-
-
Save ctataryn/45dfa25be14921e71e63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ApiModel("Outage Message") | |
public class OutageDto { | |
private String applicationName; | |
private DateTime outageDate; | |
private String message; | |
public OutageDto() {} | |
public OutageDto(Locale locale, Outage outage) { | |
this.applicationName = "My App"; | |
this.outageDate = new DateTime(outage.getStartTime()); | |
this.message = LtoUtils.isFrench(locale) ? outage.getFrenchMessage() : outage.getEnglishMessage(); | |
} | |
@JsonProperty("application_name") | |
@ApiModelProperty(value = "The name of the Application this Outage is for") | |
public String getApplicationName() { | |
return applicationName; | |
} | |
public void setApplicationName(String applicationName) { | |
this.applicationName = applicationName; | |
} | |
@JsonSerialize(using = JodaDateTimeSerializer.class) | |
@JsonProperty("outage_date") | |
public DateTime getOutageDate() { | |
return outageDate; | |
} | |
public void setOutageDate(DateTime outageDate) { | |
this.outageDate = outageDate; | |
} | |
@JsonProperty("message") | |
public String getMessage() { | |
return message; | |
} | |
public void setMessage(String message) { | |
this.message = message; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ctataryn How about making your model annotated like so, i.e. annotating the fields instead of the getters... if that doesnt work try annotating the setters...