package api.unibill.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.unicore.component_manual.ProcessingInfo;
import api.util.DateFormat;
import api.util.LongFormat;
import api.util.StringFormat;
import java.util.Date;
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;
 
/**
 * @author CodeGen [Liza Zhydok]
 * @company UnitedThinkers
 * @since 2018/07/18
 */
 
@JsonSerialize(include=NON_NULL)
@XmlType(propOrder={"id", "createDate", "holderName", "accountNumber", "city", "accountAccessory", "token", "street", "state", "zipCode", "phone", "email", "gatewayTransactionId", "approvalCode", "responseDate", "responseCode", "responseMessage"})
@JsonPropertyOrder({"id", "createDate", "holderName", "accountNumber", "city", "accountAccessory", "token", "street", "state", "zipCode", "phone", "email", "gatewayTransactionId", "approvalCode", "responseDate", "responseCode", "responseMessage"})
@XmlAccessorType(XmlAccessType.NONE)
@XmlSeeAlso(ProcessingInfo.class)
public abstract class AbstractProcessingInfo extends UnoComponent<unibill.model.CaptureInfo> {
 
    @FormParam("id")
    @LongFormat
    @DefaultValue(LONG_NULL_CODE)
    protected Long id;
 
    @FormParam("createDate")
    @DateFormat
    @DefaultValue(DATE_NULL_CODE)
    protected Date createDate;
 
    @FormParam("holderName")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String holderName;
 
    @FormParam("accountNumber")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String accountNumber;
 
    @FormParam("city")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String city;
 
    @FormParam("accountAccessory")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String accountAccessory;
 
    @FormParam("token")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String token;
 
    @FormParam("street")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String street;
 
    @FormParam("state")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String state;
 
    @FormParam("zipCode")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String zipCode;
 
    @FormParam("phone")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String phone;
 
    @FormParam("email")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String email;
 
    @FormParam("gatewayTransactionId")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String gatewayTransactionId;
 
    @FormParam("approvalCode")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String approvalCode;
 
    @FormParam("responseDate")
    @DateFormat
    @DefaultValue(DATE_NULL_CODE)
    protected Date responseDate;
 
    @FormParam("responseCode")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String responseCode;
 
    @FormParam("responseMessage")
    @StringFormat
    @DefaultValue(STRING_NULL_CODE)
    protected String responseMessage;
 
 
    public AbstractProcessingInfo(){
        super();
        applyDefaults();
    }
 
    public AbstractProcessingInfo(unibill.model.CaptureInfo object){
        super(object);
    }
 
 
    private void applyDefaults() {
        if (!isProxyObject()) {
            id = LONG_NULL;
            createDate = DATE_NULL;
            holderName = STRING_NULL;
            accountNumber = STRING_NULL;
            city = STRING_NULL;
            accountAccessory = STRING_NULL;
            token = STRING_NULL;
            street = STRING_NULL;
            state = STRING_NULL;
            zipCode = STRING_NULL;
            phone = STRING_NULL;
            email = STRING_NULL;
            gatewayTransactionId = STRING_NULL;
            approvalCode = STRING_NULL;
            responseDate = DATE_NULL;
            responseCode = 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("processing-info: {");
        sb.append("id: ");
        sb.append(id);
        sb.append(',').append(' ');
        sb.append("createDate: ");
        sb.append(createDate);
        sb.append(',').append(' ');
        sb.append("holderName: ");
        sb.append(holderName);
        sb.append(',').append(' ');
        sb.append("accountNumber: ");
        sb.append(accountNumber);
        sb.append(',').append(' ');
        sb.append("city: ");
        sb.append(city);
        sb.append(',').append(' ');
        sb.append("accountAccessory: ");
        sb.append(accountAccessory);
        sb.append(',').append(' ');
        sb.append("token: ");
        sb.append(token);
        sb.append(',').append(' ');
        sb.append("street: ");
        sb.append(street);
        sb.append(',').append(' ');
        sb.append("state: ");
        sb.append(state);
        sb.append(',').append(' ');
        sb.append("zipCode: ");
        sb.append(zipCode);
        sb.append(',').append(' ');
        sb.append("phone: ");
        sb.append(phone);
        sb.append(',').append(' ');
        sb.append("email: ");
        sb.append(email);
        sb.append(',').append(' ');
        sb.append("gatewayTransactionId: ");
        sb.append(gatewayTransactionId);
        sb.append(',').append(' ');
        sb.append("approvalCode: ");
        sb.append(approvalCode);
        sb.append(',').append(' ');
        sb.append("responseDate: ");
        sb.append(responseDate);
        sb.append(',').append(' ');
        sb.append("responseCode: ");
        sb.append(responseCode);
        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;
    }
 
 
    @XmlAttribute(name="createDate")
    @XmlJavaTypeAdapter(api.util.DateTimeAdapter.class)
    @FormParam("createDate")
    @DateFormat
    @JsonSerialize(using=api.util.DateTimeSerializer.class, include = NON_NULL)
    @JsonDeserialize(using=api.util.DateDeserializer.class)
    public Date getCreateDate(){
        return createDate;
    }
 
 
    @XmlAttribute(name="holderName")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("holderName")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 150)
    public String getHolderName(){
        return holderName;
    }
 
 
    @XmlAttribute(name="accountNumber")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("accountNumber")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 50)
    public String getAccountNumber(){
        return accountNumber;
    }
 
    public void setAccountNumber(String value){
        this.accountNumber = value;
    }
 
    @XmlAttribute(name="city")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("city")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 50)
    public String getCity(){
        return city;
    }
 
 
    @XmlAttribute(name="accountAccessory")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("accountAccessory")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 17)
    public String getAccountAccessory(){
        return accountAccessory;
    }
 
 
    @XmlAttribute(name="token")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("token")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 40)
    public String getToken(){
        return token;
    }
 
 
    @XmlAttribute(name="street")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("street")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 128)
    public String getStreet(){
        return street;
    }
 
 
    @XmlAttribute(name="state")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("state")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 3)
    public String getState(){
        return state;
    }
 
 
    @XmlAttribute(name="zipCode")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("zipCode")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 10)
    public String getZipCode(){
        return zipCode;
    }
 
 
    @XmlAttribute(name="phone")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("phone")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 15)
    public String getPhone(){
        return phone;
    }
 
 
    @XmlAttribute(name="email")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("email")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 100)
    public String getEmail(){
        return email;
    }
 
 
    @XmlAttribute(name="gatewayTransactionId")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("gatewayTransactionId")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    public String getGatewayTransactionId(){
        return gatewayTransactionId;
    }
 
 
    @XmlAttribute(name="approvalCode")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("approvalCode")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 60)
    public String getApprovalCode(){
        return approvalCode;
    }
 
 
    @XmlAttribute(name="responseDate")
    @XmlJavaTypeAdapter(api.util.DateTimeAdapter.class)
    @FormParam("responseDate")
    @DateFormat
    @JsonSerialize(using=api.util.DateTimeSerializer.class, include = NON_NULL)
    @JsonDeserialize(using=api.util.DateDeserializer.class)
    public Date getResponseDate(){
        return responseDate;
    }
 
 
    @XmlAttribute(name="responseCode")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("responseCode")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 3)
    public String getResponseCode(){
        return responseCode;
    }
 
 
    @XmlAttribute(name="responseMessage")
    @XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
    @FormParam("responseMessage")
    @StringFormat
    @JsonDeserialize(using = api.util.StringDeserializer.class)
    @Size(max = 255)
    public String getResponseMessage(){
        return responseMessage;
    }
 
 
    public abstract String getAddress();
 
 
}