Coverage Report - org.paneris.jammyjoes.mvp.EmptyStringConverter
 
Classes in this File Line Coverage Branch Coverage Complexity
EmptyStringConverter
100%
4/4
N/A
1.667
EmptyStringConverter$1
100%
4/4
100%
2/2
1.667
 
 1  
 package org.paneris.jammyjoes.mvp;
 2  
 
 3  
 
 4  
 public class EmptyStringConverter implements Converter {
 5  
 
 6  
   Converter _converter;
 7  4
   public EmptyStringConverter(Converter converter) {
 8  4
     _converter = converter;
 9  4
   }
 10  
 
 11  
   public Object convert(String string) {
 12  5
      return new NullConverter(new Converter() {
 13  5
       public Object convert(String string) {
 14  4
         if ("".equals(string)) {
 15  2
           return null;
 16  
         }
 17  2
         return _converter.convert(string);
 18  
       }}).convert(string);
 19  
   }
 20  
 
 21  
 }