Coverage Report - org.kuali.rice.kns.lookup.valuefinder.SequenceValueFinder
 
Classes in this File Line Coverage Branch Coverage Complexity
SequenceValueFinder
0%
0/9
N/A
1
 
 1  
 package org.kuali.rice.kns.lookup.valuefinder;
 2  
 
 3  
 import org.kuali.rice.kns.bo.BusinessObject;
 4  
 import org.kuali.rice.kns.service.KNSServiceLocator;
 5  
 import org.kuali.rice.kns.service.SequenceAccessorService;
 6  
 
 7  
 public class SequenceValueFinder implements ValueFinder {
 8  
 
 9  
     private final Class<? extends BusinessObject> associatedBo;
 10  
     private final String sequenceName;
 11  
 
 12  0
     public SequenceValueFinder(final Class<? extends BusinessObject> associatedBo, final String sequenceName) {
 13  0
         this.associatedBo = associatedBo;
 14  0
         this.sequenceName = sequenceName;
 15  0
     }
 16  
 
 17  
     /**
 18  
      * Get the next sequence number value as a Long.
 19  
      */
 20  
     public final Long getLongValue() {
 21  0
             SequenceAccessorService sas = KNSServiceLocator.getSequenceAccessorService();
 22  0
         return sas.getNextAvailableSequenceNumber(sequenceName, associatedBo);
 23  
     }
 24  
 
 25  
     /**
 26  
      * @see org.kuali.rice.kns.lookup.valuefinder.ValueFinder#getValue()
 27  
      */
 28  
     public final String getValue() {
 29  0
         return getLongValue().toString();
 30  
     }
 31  
 
 32  
         public final String getSequenceName() {
 33  0
                 return sequenceName;
 34  
         }
 35  
 
 36  
     public final Class<? extends BusinessObject> getAssociatedBo() {
 37  0
         return associatedBo;
 38  
     }
 39  
 }