daily pastebin goal
70%
SHARE
TWEET

LineApplicationDetails

a guest May 16th, 2018 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package gov.bsp.lcmis.domain.lineapplication;
  2.  
  3. import java.math.BigDecimal;
  4. import java.util.Date;
  5. import java.util.Map;
  6.  
  7. import org.slf4j.Logger;
  8. import org.slf4j.LoggerFactory;
  9.  
  10. import gov.bsp.lcmis.domain.utils.ParameterizedSpecification;
  11.  
  12. public class LineApplicationDetails{
  13.  
  14.     private static final Logger log = LoggerFactory.getLogger(LineApplicationDetails.class);
  15.  
  16.    
  17.     private String bankName;// or BANK id? (from autocomplete)
  18.    
  19.     private int bankId;
  20.    
  21.     private Date applicationDate;
  22.    
  23.     private BigDecimal appliedLineAmount = BigDecimal.ZERO;
  24.  
  25.     private String reasonForApplicationOfEmergencyLine;
  26.    
  27.     private String bankBoardResNo;
  28.    
  29.     private Date bankBoardResDate;
  30.  
  31.     private String dtsNumber;
  32.    
  33.     private String lineReferenceNumber;
  34.    
  35.     private Map<String, String> mergeParameterMap;
  36.    
  37.     private LineApplicationSpecificationFactory lineSpecFactory;
  38.    
  39.     public String getBankName() {
  40.         return bankName;
  41.     }
  42.  
  43.     public void setBankName(String bankName) {
  44.         this.bankName = bankName;
  45.     }
  46.    
  47.     public int getBankId() {
  48.         return bankId;
  49.     }
  50.  
  51.     public void setBankId(int bankId) {
  52.         this.bankId = bankId;
  53.     }
  54.  
  55.     public Date getApplicationDate() {
  56.         return applicationDate == null ? null : (Date) applicationDate.clone();
  57.     }
  58.  
  59.     public void setApplicationDate(Date applicationDate) {
  60.         this.applicationDate = (applicationDate == null ? null : (Date) applicationDate.clone());
  61.     }
  62.  
  63.     public BigDecimal getAppliedLineAmount() {
  64.         return appliedLineAmount;
  65.     }
  66.  
  67.     public void setAppliedLineAmount(BigDecimal appliedLineAmount) {
  68.         this.appliedLineAmount = appliedLineAmount;
  69.     }
  70.  
  71.     public String getReasonForApplicationOfEmergencyLine() {
  72.         return reasonForApplicationOfEmergencyLine;
  73.     }
  74.  
  75.     public void setReasonForApplicationOfEmergencyLine(String reasonForApplicationOfEmergencyLine) {
  76.         this.reasonForApplicationOfEmergencyLine = reasonForApplicationOfEmergencyLine;
  77.     }
  78.  
  79.     public String getBankBoardResNo() {
  80.         return bankBoardResNo;
  81.     }
  82.  
  83.     public void setBankBoardResNo(String bankBoardResNo) {
  84.         this.bankBoardResNo = bankBoardResNo;
  85.     }
  86.  
  87.     public Date getBankBoardResDate() {
  88.         return bankBoardResDate == null ? null : (Date)bankBoardResDate.clone();
  89.     }
  90.  
  91.     public void setBankBoardResDate(Date bankBoardResDate) {
  92.         this.bankBoardResDate = (bankBoardResDate == null ? null : (Date)bankBoardResDate.clone());
  93.     }
  94.  
  95.     public String getDtsNumber() {
  96.         return dtsNumber;
  97.     }
  98.  
  99.     public void setDtsNumber(String dtsNumber) {
  100.         this.dtsNumber = dtsNumber;
  101.     }
  102.  
  103.     public String getLineReferenceNumber() {
  104.         return lineReferenceNumber;
  105.     }
  106.  
  107.     public void setLineReferenceNumber(String lineReferenceNumber) {
  108.         this.lineReferenceNumber = lineReferenceNumber;
  109.     }
  110.    
  111.     public ParameterizedSpecification merge(LineApplicationDetails edited){
  112.         if(log.isDebugEnabled()){
  113.             log.debug("MCI >> merge");
  114.         }
  115.         LineApplicationSpecification spec = lineSpecFactory.generate();
  116.        
  117.         boolean hasNoChanges = LineDetailsMergeStrategy.merge(edited,this);
  118.         if (!hasNoChanges) {
  119.             spec.set(this);
  120.             //SAMPLE
  121.             //WHERE APPLIED_LINE_AMOUNT = 0 (DEPENDS ON THE QUERY)
  122.             //<TODO>for conditional parameters
  123.             spec.setParameter(mergeParameterMap.get("appliedLineAmountEquals"), BigDecimal.ZERO);
  124.         }else{
  125.             spec = null;
  126.         }
  127.         if(log.isDebugEnabled()){
  128.             log.debug("MCO >> merge");
  129.         }
  130.         return spec;
  131.     }
  132.  
  133.     public void setMergeParameterMap(Map<String, String> mergeParameterMap) {
  134.         this.mergeParameterMap = mergeParameterMap;
  135.     }
  136.    
  137.     public void setLineSpecFactory(LineApplicationSpecificationFactory lineSpecFactory) {
  138.         this.lineSpecFactory = lineSpecFactory;
  139.     }
  140.    
  141. }
RAW Paste Data
Pastebin PRO 'MAY MADNESS'!
Get 60% OFF Pastebin PRO accounts!
Top