/** * Returns whether this link matches the given {@code rel} and {@code type} * values. * * @param relToMatch {@code rel} value to match or {@code null} to match any * {@code rel} value. * @param typeToMatch {@code type} value to match or {@code null} to match any * {@code type} value. */ public boolean matches(String relToMatch, String typeToMatch) { return (relToMatch == null || relToMatch.equals(getRel())) && (typeToMatch == null || typeToMatch.equals(this.type)); }
/** * Returns whether this link matches the given {@code rel} and {@code type} * values. * * @param relToMatch {@code rel} value to match or {@code null} to match any * {@code rel} value. * @param typeToMatch {@code type} value to match or {@code null} to match any * {@code type} value. */ public boolean matches(String relToMatch, String typeToMatch) { return (relToMatch == null || relToMatch.equals(getRel())) && (typeToMatch == null || typeToMatch.equals(this.type)); }
/** * Returns whether this link matches the given {@code rel} and {@code type} * values. * * @param relToMatch {@code rel} value to match or {@code null} to match any * {@code rel} value. * @param typeToMatch {@code type} value to match or {@code null} to match any * {@code type} value. */ public boolean matches(String relToMatch, String typeToMatch) { return (relToMatch == null || relToMatch.equals(getRel())) && (typeToMatch == null || typeToMatch.equals(this.type)); }
/** * Returns all the parent links contained in the entry. */ public List<AnalyticsLink> getParentLinks() { List<AnalyticsLink> links = new ArrayList<AnalyticsLink>(); for (Link link : getLinks()) { if (link.getRel().equals(AnalyticsLink.Rel.PARENT)) { links.add((AnalyticsLink) link); } } return links; }
/** * Returns all the child links contained in the entry. */ public List<AnalyticsLink> getChildLinks() { List<AnalyticsLink> links = new ArrayList<AnalyticsLink>(); for (Link link : getLinks()) { if (link.getRel().equals(AnalyticsLink.Rel.CHILD)) { links.add((AnalyticsLink) link); } } return links; }
/** * Gets a link to the "Get Upload Token" action. * * @return a link with rel {@link YouTubeNamespace#GET_UPLOAD_TOKEN_REL} * or {@code null}. */ public Link getGetUploadTokenActionLink() { for (Link link : getLinks()) { if (YouTubeNamespace.GET_UPLOAD_TOKEN_REL.equals(link.getRel())) { return link; } } return null; } }
/** * Gets a link to the "Get Upload Token" action. * * @return a link with rel {@link YouTubeNamespace#GET_UPLOAD_TOKEN_REL} * or {@code null}. */ public Link getGetUploadTokenActionLink() { for (Link link : getLinks()) { if (YouTubeNamespace.GET_UPLOAD_TOKEN_REL.equals(link.getRel())) { return link; } } return null; } }
/** * Returns the link with the given targetKind. It returns {@code null} if a * link with the given targetKind value is not found. */ public AnalyticsLink getChildLink(String targetKind) { for (Link link : getLinks()) { if (link.getRel().equals(AnalyticsLink.Rel.CHILD)) { AnalyticsLink analyticsLink = (AnalyticsLink) link; if (analyticsLink.getTargetKind().equals(targetKind)) { return analyticsLink; } } } return null; }