package api.unicore.component;
import static org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion.NON_NULL;
import api.unicore.component_manual.ServiceResponse;
import api.util.IntegerFormat;
import api.util.StringFormat;
import javax.ws.rs.FormParam;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.codehaus.jackson.annotate.JsonPropertyOrder;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;
/**
* @author CodeGen
* @company UnitedThinkers
* @since 2012/06/09
*/
@JsonSerialize(include=NON_NULL)
@XmlType(propOrder={"code", "httpStatusCode", "userMessage", "developerMessage", "detailMessage"})
@JsonPropertyOrder({"code", "httpStatusCode", "userMessage", "developerMessage", "detailMessage"})
@XmlRootElement(name="response")
public class ServiceResponse {
@FormParam("code")
@StringFormat
protected String code;
@FormParam("httpStatusCode")
@IntegerFormat
protected Integer httpStatusCode;
@FormParam("userMessage")
@StringFormat
protected String userMessage;
@FormParam("developerMessage")
@StringFormat
protected String developerMessage;
@FormParam("detailMessage")
@StringFormat
protected String detailMessage;
public ServiceResponse(){
}
public void initializeNew() {
assignDefaults();
}
public void assignDefaults(){
code = "OK1";
}
@Override
public String toString(){
StringBuilder sb = new StringBuilder();
sb.append("response: {");
sb.append("code: ");
sb.append(code);
sb.append(',').append(' ');
sb.append("httpStatusCode: ");
sb.append(httpStatusCode);
sb.append(',').append(' ');
sb.append("userMessage: ");
sb.append(userMessage);
sb.append(',').append(' ');
sb.append("developerMessage: ");
sb.append(developerMessage);
sb.append(',').append(' ');
sb.append("detailMessage: ");
sb.append(detailMessage);
sb.append('}');
return sb.toString();
}
@XmlAttribute(name="code")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("code")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getCode(){
return code;
}
public void setCode(String value){
this.code = value;
}
@XmlAttribute(name="httpStatusCode")
@XmlJavaTypeAdapter(value=api.util.IntegerAdapter.class, type=Integer.class)
@FormParam("httpStatusCode")
@IntegerFormat
@JsonDeserialize(using=api.util.NumberDeserializer.class)
public Integer getHttpStatusCode(){
return httpStatusCode;
}
public void setHttpStatusCode(Integer value){
this.httpStatusCode = value;
}
@XmlAttribute(name="userMessage")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("userMessage")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getUserMessage(){
return userMessage;
}
public void setUserMessage(String value){
this.userMessage = value;
}
@XmlAttribute(name="developerMessage")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("developerMessage")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getDeveloperMessage(){
return developerMessage;
}
public void setDeveloperMessage(String value){
this.developerMessage = value;
}
@XmlAttribute(name="detailMessage")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("detailMessage")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getDetailMessage(){
return detailMessage;
}
public void setDetailMessage(String value){
this.detailMessage = value;
}
}