Coverage Report - yarfraw.mapping.backward.impl.Utils
 
Classes in this File Line Coverage Branch Coverage Complexity
Utils
50% 
60% 
0
 
 1  
 package yarfraw.mapping.backward.impl;
 2  
 
 3  
 import java.util.List;
 4  
 
 5  
 import javax.xml.bind.JAXBElement;
 6  
 
 7  
 import org.apache.commons.collections.CollectionUtils;
 8  
 
 9  
 import yarfraw.core.datamodel.Link;
 10  
 import yarfraw.core.datamodel.Person;
 11  
 import yarfraw.generated.rss10.elements.DcType;
 12  
 
 13  
 class Utils{
 14  0
   private Utils(){}
 15  
   
 16  
   @SuppressWarnings("unchecked")
 17  
   public static String getDcTypeText(JAXBElement<?> dcType) {
 18  720
     return dcType == null ? null : ((JAXBElement<DcType>)dcType).getValue().getValue();
 19  
   }
 20  
   
 21  
   /**
 22  
    * Gets the <code>emailOrText</code> field of the first person in the input list.
 23  
    * @param persons
 24  
    * @return
 25  
    */
 26  
   public static String getEmailOrText(List<Person> persons){
 27  0
     String ret = null;
 28  0
     if(CollectionUtils.isNotEmpty(persons)){
 29  0
       Person p = persons.get(0);
 30  0
       ret = p == null ? null : p.getEmailOrText();
 31  
     }
 32  0
     return ret;
 33  
   }
 34  
   
 35  
   /**
 36  
    * Gets the <code>href</code> field of the first link in the input list.
 37  
    * @param links
 38  
    * @return
 39  
    */
 40  
   public static String getHrefLink(List<Link> links){
 41  228
     String ret = null;
 42  228
     if(CollectionUtils.isNotEmpty(links)){
 43  228
       Link l = links.get(0);
 44  228
       ret = l == null ? null : l.getHref();
 45  
     }
 46  228
     return ret;
 47  
   }
 48  
 }