package api.unicore.component;
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.MerchantChargeInfo;
import api.util.StringFormat;
import iapp.services.ServerObject;
import iapp.util.audit.AuditHelper;
import javax.validation.constraints.NotNull;
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 [Olga Kazmirenko]
* @company UnitedThinkers
* @since 2013/10/03
*/
@JsonSerialize(include=NON_NULL)
@XmlType(propOrder={"holderName", "routingNumber", "accountNumber", "tokenCode", "bankName", "bankPhone", "accountUsageClCharge"})
@JsonPropertyOrder({"holderName", "routingNumber", "accountNumber", "tokenCode", "bankName", "bankPhone", "accountUsageClCharge"})
@XmlAccessorType(XmlAccessType.NONE)
@XmlSeeAlso(MerchantChargeInfo.class)
public abstract class AbstractMerchantChargeInfo extends UnoComponent<unicore.model.MerchantAccountGroup> {
@FormParam("holderName")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String holderName;
@FormParam("routingNumber")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String routingNumber;
@FormParam("accountNumber")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String accountNumber;
@FormParam("tokenCode")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String tokenCode;
@FormParam("bankName")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String bankName;
@FormParam("bankPhone")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String bankPhone;
@FormParam("accountUsageClCharge")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String accountUsageClCharge;
public AbstractMerchantChargeInfo(){
super();
applyDefaults();
}
public AbstractMerchantChargeInfo(unicore.model.MerchantAccountGroup object){
super(object);
}
private void applyDefaults() {
if (!isProxyObject()) {
holderName = STRING_NULL;
routingNumber = STRING_NULL;
accountNumber = STRING_NULL;
tokenCode = STRING_NULL;
bankName = STRING_NULL;
bankPhone = STRING_NULL;
accountUsageClCharge = 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("charge-info: {");
sb.append("holderName: ");
sb.append(holderName);
sb.append(',').append(' ');
sb.append("routingNumber: ");
sb.append(routingNumber);
sb.append(',').append(' ');
sb.append("accountNumber: ");
sb.append(accountNumber);
sb.append(',').append(' ');
sb.append("tokenCode: ");
sb.append(tokenCode);
sb.append(',').append(' ');
sb.append("bankName: ");
sb.append(bankName);
sb.append(',').append(' ');
sb.append("bankPhone: ");
sb.append(bankPhone);
sb.append(',').append(' ');
sb.append("accountUsageClCharge: ");
sb.append(accountUsageClCharge);
sb.append('}');
return sb.toString();
}
@XmlAttribute(name="holderName")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("holderName")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getHolderName(){
return holderName;
}
public void setHolderName(String value){
this.holderName = value;
}
@XmlAttribute(name="routingNumber")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("routingNumber")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getRoutingNumber(){
return routingNumber;
}
public void setRoutingNumber(String value){
this.routingNumber = value;
}
@XmlAttribute(name="accountNumber")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("accountNumber")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getAccountNumber(){
return accountNumber;
}
public void setAccountNumber(String value){
this.accountNumber = value;
}
@XmlAttribute(name="tokenCode")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("tokenCode")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getTokenCode(){
return tokenCode;
}
public void setTokenCode(String value){
this.tokenCode = value;
}
@XmlAttribute(name="bankName")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("bankName")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getBankName(){
return bankName;
}
public void setBankName(String value){
this.bankName = value;
}
@XmlAttribute(name="bankPhone")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("bankPhone")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getBankPhone(){
return bankPhone;
}
public void setBankPhone(String value){
this.bankPhone = value;
}
@XmlAttribute(name="accountUsageClCharge")
@XmlJavaTypeAdapter(value=api.util.StringAdapter.class, type=String.class)
@FormParam("accountUsageClCharge")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
@NotNull
public String getAccountUsageClCharge(){
return accountUsageClCharge;
}
public void setAccountUsageClCharge(String value){
this.accountUsageClCharge = value;
}
public void audit(AuditHelper helper, ServerObject object) {
unicore.model.MerchantAccountGroup s_object = (unicore.model.MerchantAccountGroup) object;
helper.audit("holderName", holderName, s_object.getBankAccountHolderNameCharge());
helper.audit("routingNumber", routingNumber, s_object.getBankRoutingNumberMaskedCharge());
helper.audit("accountNumber", accountNumber, s_object.getBankAccountNumberMaskedCharge());
helper.audit("tokenCode", tokenCode, s_object.getTokenCodeCharge());
helper.audit("bankName", bankName, s_object.getBankNameCharge());
helper.audit("bankPhone", bankPhone, s_object.getBankPhoneCharge());
helper.audit("accountUsageClCharge", accountUsageClCharge, s_object.getAccountUsageClCharge() == null ? null : s_object.getAccountUsageClCharge().getValue());
}
public static String objectTypeCode(){
return "charge-info";
}
}