| 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 |
|
|
| 23 |
|
|
| 24 |
|
|
| 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 |
|
|
| 37 |
|
|
| 38 |
|
|
| 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 |
|
} |