final Entry aEntry = new Entry();
aEntry.setModules(ModuleUtils.cloneModules(sEntry.getModules()));
aEntry.setId(sEntry.getUri());
final SyndContent sTitle = sEntry.getTitleEx();
if (sTitle != null) {
final Content title = new Content();
final String type = sTitle.getType();
if (type != null) {
title.setType(type);
}
final String mode = sTitle.getMode();
if (mode != null) {
title.setMode(mode);
}
title.setValue(sTitle.getValue());
aEntry.setTitleEx(title);
}
// separate SyndEntry's links collection into alternate and other links
final List<Link> alternateLinks = new ArrayList<Link>();
final List<Link> otherLinks = new ArrayList<Link>();
final List<SyndLink> syndLinks = sEntry.getLinks();
if (syndLinks != null) {
for (final SyndLink syndLink : syndLinks) {
final Link link = createAtomLink(syndLink);
final String rel = link.getRel();
if (Strings.isBlank(rel) || "alternate".equals(rel)) {
alternateLinks.add(link);
} else {
otherLinks.add(link);
}
}
}
// no alternate link? then use THE link if there is one
final String sLink = sEntry.getLink();
if (alternateLinks.isEmpty() && sLink != null) {
final Link link = new Link();
link.setRel("alternate");
link.setHref(sLink);
alternateLinks.add(link);
}
final List<SyndEnclosure> sEnclosures = sEntry.getEnclosures();
if (sEnclosures != null) {
for (final SyndEnclosure syndEnclosure : sEnclosures) {
final Link link = createAtomEnclosure(syndEnclosure);
otherLinks.add(link);
}
}
if (!alternateLinks.isEmpty()) {
aEntry.setAlternateLinks(alternateLinks);
}
if (!otherLinks.isEmpty()) {
aEntry.setOtherLinks(otherLinks);
}
final SyndContent sContent = sEntry.getDescription();
if (sContent != null) {
final Content content = new Content();
content.setType(sContent.getType());
content.setValue(sContent.getValue());
content.setMode(Content.ESCAPED);
aEntry.setSummary(content);
}
final List<SyndContent> contents = sEntry.getContents();