From 3505725a501d87ca9eac4b533d0b5014cc68825c Mon Sep 17 00:00:00 2001 From: kebernet Date: Sat, 2 Apr 2011 01:43:06 +0000 Subject: [PATCH] Added a finder method. --- .../java/com/sun/syndication/feed/atom/Entry.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sun/syndication/feed/atom/Entry.java b/src/main/java/com/sun/syndication/feed/atom/Entry.java index cc0683f..1023ac2 100644 --- a/src/main/java/com/sun/syndication/feed/atom/Entry.java +++ b/src/main/java/com/sun/syndication/feed/atom/Entry.java @@ -250,8 +250,8 @@ public class Entry implements Cloneable, Serializable, Extendable { boolean mediaEntry = false; List links = getOtherLinks(); - for (Iterator it = links.iterator(); it.hasNext();) { - Link link = (Link) it.next(); + for (Iterator it = links.iterator(); it.hasNext();) { + Link link = it.next(); if ("edit-media".equals(link.getRel())) { mediaEntry = true; @@ -560,4 +560,14 @@ public class Entry implements Cloneable, Serializable, Extendable { public String toString() { return _objBean.toString(); } + + + public Link findRelatedLink(String relation){ + for(Link l : this._otherLinks){ + if(relation.equals(l.getRel())){ + return l; + } + } + return null; + } }