package api.unicore.component.fees;
import static api.util.ComponentConstants.INTEGER_NULL;
import static api.util.ComponentConstants.INTEGER_NULL_CODE;
import static api.util.ComponentConstants.STRING_NULL;
import static api.util.ComponentConstants.STRING_NULL_CODE;
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
import api.unicore.component.fees_manual.FeeCycle;
import api.util.IntegerFormat;
import api.util.StringFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import iapp.util.audit.AuditHelper;
import jakarta.ws.rs.DefaultValue;
import jakarta.ws.rs.FormParam;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlSeeAlso;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
* @author CodeGen [Liza Zhydok]
* @company UnitedThinkers
* @since 2013/03/01
*/
@JsonInclude(NON_NULL)
@XmlType(propOrder={"days", "monthlyFeeDay"})
@JsonPropertyOrder({"days", "monthlyFeeDay"})
@XmlAccessorType(XmlAccessType.NONE)
@XmlSeeAlso(FeeCycle.class)
public abstract class AbstractFeeCycle {
@FormParam("days")
@StringFormat
@DefaultValue(STRING_NULL_CODE)
protected String days = STRING_NULL;
@FormParam("monthlyFeeDay")
@IntegerFormat
@DefaultValue(INTEGER_NULL_CODE)
protected Integer monthlyFeeDay = INTEGER_NULL;
public AbstractFeeCycle(){
}
public String toString(){
StringBuilder sb = new StringBuilder();
sb.append("cycle: {");
sb.append("days: ");
sb.append(days);
sb.append(',').append(' ');
sb.append("monthlyFeeDay: ");
sb.append(monthlyFeeDay);
sb.append('}');
return sb.toString();
}
@XmlAttribute(name="days")
@XmlJavaTypeAdapter(api.util.StringAdapter.class)
@FormParam("days")
@StringFormat
@JsonDeserialize(using = api.util.StringDeserializer.class)
public String getDays(){
return days;
}
public void setDays(String value){
this.days = value;
}
@XmlAttribute(name="monthlyFeeDay")
@XmlJavaTypeAdapter(api.util.IntegerAdapter.class)
@FormParam("monthlyFeeDay")
@IntegerFormat
@JsonDeserialize(using=api.util.NumberDeserializer.class)
public Integer getMonthlyFeeDay(){
return monthlyFeeDay;
}
public void setMonthlyFeeDay(Integer value){
this.monthlyFeeDay = value;
}
public void audit(AuditHelper helper, AbstractFeeCycle old) {
helper.audit("days", days, old.getDays());
helper.audit("monthlyFeeDay", monthlyFeeDay, old.getMonthlyFeeDay());
}
}