package api.unicharge.component;
import static api.util.ComponentConstants.DATE_NULL;
import static api.util.ComponentConstants.DATE_NULL_CODE;
import static api.util.ComponentConstants.LONG_NULL;
import static api.util.ComponentConstants.LONG_NULL_CODE;
import static api.util.ComponentConstants.STRING_NULL;
import static api.util.ComponentConstants.STRING_NULL_CODE;
import static org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion.NON_NULL;
import api.UnoComponent;
import api.unicharge.component_manual.TerminalOrder;
import api.unicore.VirtualFields;
import api.util.DateFormat;
import api.util.LongFormat;
import api.util.StringFormat;
import iapp.services.ServerObject;
import iapp.util.audit.AuditHelper;
import java.util.Date;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.FormParam;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
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;
import unipay.validator.CustomValidator;
/**
* @author CodeGen [Liza Zhydok]
* @company UnitedThinkers
* @since 2015/10/05
*/
@JsonSerialize(include=NON_NULL)
@XmlType(propOrder={"id", "shippingName", "shippingStreet", "shippingStreet2", "shippingCity", "shippingState", "shippingZipCode", "shippingCountryCode", "shippingDate", "notes", "trackingNumber", "fulfillmentCenterCode", "contactName", "phone", "email", "terminalOrderType", "shippingMethodCode", "paymentArrangementType", "shipmentNumber", "terminalSupportNumber", "responseMessage"})
@JsonPropertyOrder({"id", "shippingName", "shippingStreet", "shippingStreet2", "shippingCity", "shippingState", "shippingZipCode", "shippingCountryCode", "shippingDate", "notes", "trackingNumber", "fulfillmentCenterCode", "contactName", "phone", "email", "terminalOrderType", "shippingMethodCode", "paymentArrangementType", "shipmentNumber", "terminalSupportNumber", "responseMessage"})
@XmlAccessorType(XmlAccessType.NONE)
@XmlSeeAlso(TerminalOrder.class)
@CustomValidator
public abstract class AbstractTerminalOrder extends UnoComponent<unicharge.model.TerminalOrder> {
@FormParam("id")
@LongFormat
@DefaultValue(LONG_NULL_CODE)
protected Long id;
@FormParam("shippingName")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String shippingName;
@FormParam("shippingStreet")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String shippingStreet;
@FormParam("shippingStreet2")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String shippingStreet2;
@FormParam("shippingCity")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String shippingCity;
@FormParam("shippingState")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String shippingState;
@FormParam("shippingZipCode")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String shippingZipCode;
@FormParam("shippingCountryCode")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String shippingCountryCode;
@FormParam("shippingDate")
@DateFormat
@DefaultValue(DATE_NULL_CODE)
protected Date shippingDate;
@FormParam("notes")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String notes;
@FormParam("trackingNumber")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String trackingNumber;
@FormParam("fulfillmentCenterCode")
@LongFormat
@DefaultValue(LONG_NULL_CODE)
protected Long fulfillmentCenterCode;
@FormParam("contactName")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String contactName;
@FormParam("phone")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String phone;
@FormParam("email")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String email;
@FormParam("terminalOrderType")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String terminalOrderType;
@FormParam("shippingMethodCode")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String shippingMethodCode;
@FormParam("paymentArrangementType")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String paymentArrangementType;
@FormParam("shipmentNumber")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String shipmentNumber;
@FormParam("terminalSupportNumber")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String terminalSupportNumber;
@FormParam("responseMessage")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String responseMessage;
public AbstractTerminalOrder(){
super();
applyDefaults();
}
public AbstractTerminalOrder(unicharge.model.TerminalOrder object){
super(object);
}
private void applyDefaults() {
if (!isProxyObject()) {
id = LONG_NULL;
shippingName = STRING_NULL;
shippingStreet = STRING_NULL;
shippingStreet2 = STRING_NULL;
shippingCity = STRING_NULL;
shippingState = STRING_NULL;
shippingZipCode = STRING_NULL;
shippingCountryCode = STRING_NULL;
shippingDate = DATE_NULL;
notes = STRING_NULL;
trackingNumber = STRING_NULL;
fulfillmentCenterCode = LONG_NULL;
contactName = STRING_NULL;
phone = STRING_NULL;
email = STRING_NULL;
terminalOrderType = STRING_NULL;
shippingMethodCode = STRING_NULL;
paymentArrangementType = STRING_NULL;
shipmentNumber = STRING_NULL;
terminalSupportNumber = STRING_NULL;
responseMessage = STRING_NULL;
}
}
@Override
public void from() {
fromInternal();
super.from();
}
protected abstract void fromInternal();
@Override
public abstract void to();
@Override
public abstract void initializeNew();
@Override
public String toString(){
StringBuilder sb = new StringBuilder();
sb.append("terminalOrder: {");
sb.append("id: ");
sb.append(id);
sb.append(',').append(' ');
sb.append("shippingName: ");
sb.append(shippingName);
sb.append(',').append(' ');
sb.append("shippingStreet: ");
sb.append(shippingStreet);
sb.append(',').append(' ');
sb.append("shippingStreet2: ");
sb.append(shippingStreet2);
sb.append(',').append(' ');
sb.append("shippingCity: ");
sb.append(shippingCity);
sb.append(',').append(' ');
sb.append("shippingState: ");
sb.append(shippingState);
sb.append(',').append(' ');
sb.append("shippingZipCode: ");
sb.append(shippingZipCode);
sb.append(',').append(' ');
sb.append("shippingCountryCode: ");
sb.append(shippingCountryCode);
sb.append(',').append(' ');
sb.append("shippingDate: ");
sb.append(shippingDate);
sb.append(',').append(' ');
sb.append("notes: ");
sb.append(notes);
sb.append(',').append(' ');
sb.append("trackingNumber: ");
sb.append(trackingNumber);
sb.append(',').append(' ');
sb.append("fulfillmentCenterCode: ");
sb.append(fulfillmentCenterCode);
sb.append(',').append(' ');
sb.append("contactName: ");
sb.append(contactName);
sb.append(',').append(' ');
sb.append("phone: ");
sb.append(phone);
sb.append(',').append(' ');
sb.append("email: ");
sb.append(email);
sb.append(',').append(' ');
sb.append("terminalOrderType: ");
sb.append(terminalOrderType);
sb.append(',').append(' ');
sb.append("shippingMethodCode: ");
sb.append(shippingMethodCode);
sb.append(',').append(' ');
sb.append("paymentArrangementType: ");
sb.append(paymentArrangementType);
sb.append(',').append(' ');
sb.append("shipmentNumber: ");
sb.append(shipmentNumber);
sb.append(',').append(' ');
sb.append("terminalSupportNumber: ");
sb.append(terminalSupportNumber);
sb.append(',').append(' ');
sb.append("responseMessage: ");
sb.append(responseMessage);
sb.append('}');
return sb.toString();
}
@XmlAttribute(name="id")
@XmlJavaTypeAdapter(value=api.util.LongAdapter.class, type=Long.class)
@FormParam("id")
@LongFormat
@JsonDeserialize(using=api.util.NumberDeserializer.class)
public Long getId(){
return id;
}
public void setId(Long value){
this.id = value;
}
@XmlAttribute(name="shippingName")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("shippingName")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@NotNull
@Size(max = 100)
@Pattern(regexp = unipay.validator.PatternName.TEXT)
public String getShippingName(){
return shippingName;
}
public void setShippingName(String value){
this.shippingName = value;
}
@XmlAttribute(name="shippingStreet")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("shippingStreet")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@NotNull
@Size(max = 128)
@Pattern(regexp = unipay.validator.PatternName.STREET)
public String getShippingStreet(){
return shippingStreet;
}
public void setShippingStreet(String value){
this.shippingStreet = value;
}
@XmlAttribute(name="shippingStreet2")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("shippingStreet2")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getShippingStreet2(){
return shippingStreet2;
}
public void setShippingStreet2(String value){
this.shippingStreet2 = value;
}
@XmlAttribute(name="shippingCity")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("shippingCity")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@NotNull
@Size(max = 50)
@Pattern(regexp = unipay.validator.PatternName.ALPHANUMERIC_EXTENDED)
public String getShippingCity(){
return shippingCity;
}
public void setShippingCity(String value){
this.shippingCity = value;
}
@XmlAttribute(name="shippingState")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("shippingState")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@NotNull
public String getShippingState(){
return shippingState;
}
public void setShippingState(String value){
this.shippingState = value;
}
@XmlAttribute(name="shippingZipCode")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("shippingZipCode")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@NotNull
public String getShippingZipCode(){
return shippingZipCode;
}
public void setShippingZipCode(String value){
this.shippingZipCode = value;
}
@XmlAttribute(name="shippingCountryCode")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("shippingCountryCode")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@Size(min = 2, max = 2)
@Pattern(regexp = unipay.validator.PatternName.ALPHA)
public String getShippingCountryCode(){
return shippingCountryCode;
}
public void setShippingCountryCode(String value){
this.shippingCountryCode = value;
}
@XmlAttribute(name="shippingDate")
@FormParam("shippingDate")
@DateFormat
@JsonDeserialize(using=api.util.DateDeserializer.class)
public Date getShippingDate(){
return shippingDate;
}
public void setShippingDate(Date value){
this.shippingDate = value;
}
@XmlAttribute(name="notes")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("notes")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@Size(max = 500)
@Pattern(regexp = unipay.validator.PatternName.TEXT)
public String getNotes(){
return notes;
}
public void setNotes(String value){
this.notes = value;
}
@XmlAttribute(name="trackingNumber")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("trackingNumber")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getTrackingNumber(){
return trackingNumber;
}
public void setTrackingNumber(String value){
this.trackingNumber = value;
}
@XmlAttribute(name="fulfillmentCenterCode")
@XmlJavaTypeAdapter(value=api.util.LongAdapter.class, type=Long.class)
@FormParam("fulfillmentCenterCode")
@LongFormat
@JsonDeserialize(using=api.util.NumberDeserializer.class)
public Long getFulfillmentCenterCode(){
return fulfillmentCenterCode;
}
public void setFulfillmentCenterCode(Long value){
this.fulfillmentCenterCode = value;
}
@XmlAttribute(name="contactName")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("contactName")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@NotNull
public String getContactName(){
return contactName;
}
public void setContactName(String value){
this.contactName = value;
}
@XmlAttribute(name="phone")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("phone")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@NotNull
@Size(max = 15)
@Pattern(regexp = unipay.validator.PatternName.NUMERIC)
public String getPhone(){
return phone;
}
public void setPhone(String value){
this.phone = value;
}
@XmlAttribute(name="email")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("email")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@NotNull
@Size(max = 100)
@Pattern(regexp = unipay.validator.PatternName.EMAIL)
public String getEmail(){
return email;
}
public void setEmail(String value){
this.email = value;
}
@XmlAttribute(name="terminalOrderType")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("terminalOrderType")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getTerminalOrderType(){
return terminalOrderType;
}
public void setTerminalOrderType(String value){
this.terminalOrderType = value;
}
@XmlAttribute(name="shippingMethodCode")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("shippingMethodCode")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getShippingMethodCode(){
return shippingMethodCode;
}
public void setShippingMethodCode(String value){
this.shippingMethodCode = value;
}
@XmlAttribute(name="paymentArrangementType")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("paymentArrangementType")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getPaymentArrangementType(){
return paymentArrangementType;
}
public void setPaymentArrangementType(String value){
this.paymentArrangementType = value;
}
@XmlAttribute(name="shipmentNumber")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("shipmentNumber")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getShipmentNumber(){
return shipmentNumber;
}
public void setShipmentNumber(String value){
this.shipmentNumber = value;
}
@XmlAttribute(name="terminalSupportNumber")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("terminalSupportNumber")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@Size(max = 20)
@Pattern(regexp = unipay.validator.PatternName.NUMERIC)
public String getTerminalSupportNumber(){
return terminalSupportNumber;
}
public void setTerminalSupportNumber(String value){
this.terminalSupportNumber = value;
}
@XmlAttribute(name="responseMessage")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("responseMessage")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getResponseMessage(){
return responseMessage;
}
public void audit(AuditHelper helper, ServerObject object) {
unicharge.model.TerminalOrder s_object = (unicharge.model.TerminalOrder) object;
helper.audit("id", id, s_object.getId());
helper.audit("shippingName", shippingName, s_object.getShippingName());
helper.audit("shippingStreet", shippingStreet, s_object.getShippingStreet1());
helper.audit("shippingStreet2", shippingStreet2, s_object.getShippingStreet2());
helper.audit("shippingCity", shippingCity, s_object.getShippingCity());
helper.audit("shippingState", shippingState, s_object.getShippingState());
helper.audit("shippingZipCode", shippingZipCode, s_object.getShippingZipCode());
helper.audit("shippingCountryCode", shippingCountryCode, s_object.getShippingCountryCode());
helper.audit("shippingDate", shippingDate, s_object.getShippingDate());
helper.audit("notes", notes, s_object.getNotes());
helper.audit("trackingNumber", trackingNumber, s_object.getTrackingNumber());
helper.audit("fulfillmentCenterCode", fulfillmentCenterCode, VirtualFields.FulfillmentCenterCode.get(s_object));
helper.audit("contactName", contactName, s_object.getContactName());
helper.audit("phone", phone, s_object.getPhone());
helper.audit("email", email, s_object.getEmail());
helper.audit("terminalOrderType", terminalOrderType, s_object.getTerminalOrderCl() == null ? null : s_object.getTerminalOrderCl().getValue());
helper.audit("shippingMethodCode", shippingMethodCode, VirtualFields.ShippingMethodCode.get(s_object));
helper.audit("paymentArrangementType", paymentArrangementType, s_object.getPaymentArrangementCl() == null ? null : s_object.getPaymentArrangementCl().getValue());
helper.audit("shipmentNumber", shipmentNumber, s_object.getShipmentNumber());
helper.audit("terminalSupportNumber", terminalSupportNumber, s_object.getTerminalSupportNumber());
helper.audit("responseMessage", responseMessage, s_object.getResponseMessage());
}
}