Coverage Report - yarfraw.mapping.forward.impl.Utils
 
Classes in this File Line Coverage Branch Coverage Complexity
Utils
91% 
100% 
0
 
 1  
 package yarfraw.mapping.forward.impl;
 2  
 
 3  
 import java.util.List;
 4  
 
 5  
 import org.apache.commons.collections.CollectionUtils;
 6  
 
 7  
 import yarfraw.core.datamodel.Link;
 8  
 import yarfraw.core.datamodel.Person;
 9  
 
 10  
 class Utils{
 11  0
   private Utils(){}
 12  
   
 13  
   /**
 14  
    * Gets the <code>emailOrText</code> field of the first person in the input list.
 15  
    * @param persons
 16  
    * @return
 17  
    */
 18  
   public static String getEmailOrText(List<Person> persons){
 19  912
     String ret = null;
 20  912
     if(CollectionUtils.isNotEmpty(persons)){
 21  123
       Person p = persons.get(0);
 22  123
       ret = p == null ? null : p.getEmailOrText();
 23  
     }
 24  912
     return ret;
 25  
   }
 26  
   
 27  
   /**
 28  
    * Gets the <code>href</code> field of the first link in the input list.
 29  
    * @param links
 30  
    * @return
 31  
    */
 32  
   public static String getHrefLink(List<Link> links){
 33  753
     String ret = null;
 34  753
     if(CollectionUtils.isNotEmpty(links)){
 35  645
       Link l = links.get(0);
 36  645
       ret = l == null ? null : l.getHref();
 37  
     }
 38  753
     return ret;
 39  
   }
 40  
 }