Coverage Report - org.webslinger.resolver.TimestampResolver
 
Classes in this File Line Coverage Branch Coverage Complexity
TimestampResolver
100%
7/7
N/A
0
TimestampResolver$TimestampResolverInfo
100%
4/4
N/A
0
 
 1  
 package org.webslinger.resolver;
 2  
 
 3  
 import java.sql.Timestamp;
 4  
 
 5  2
 public final class TimestampResolver extends BasicTypeResolver<Timestamp> {
 6  1
     public static final TimestampResolver RESOLVER = new TimestampResolver();
 7  
 
 8  1
     private TimestampResolver() {
 9  1
     }
 10  
 
 11  
     protected String getString(Timestamp object) {
 12  1
         return Long.toString(object.getTime());
 13  
     }
 14  
 
 15  
     protected Timestamp newObject(Class<? extends Timestamp> wantedType, String value) {
 16  1
         return new Timestamp(Long.parseLong(value));
 17  
     }
 18  
 
 19  
     public Class<Timestamp> primaryClass() {
 20  1
         return Timestamp.class;
 21  
     }
 22  
 
 23  4
     public static class TimestampResolverInfo extends BasicTypeResolverInfo<Timestamp> {
 24  
         public String getType() {
 25  1
             return "java.sql.Timestamp";
 26  
         }
 27  
 
 28  
         public TimestampResolver getResolver() {
 29  2
             return RESOLVER;
 30  
         }
 31  
 
 32  
         public String getName() {
 33  1
             return "timestamp";
 34  
         }
 35  
     }
 36  
 }