package com.dongxuexidu.douban4j.model.note; import com.dongxuexidu.douban4j.model.IDoubanObject; import com.dongxuexidu.douban4j.model.common.DoubanAuthorObj; import com.dongxuexidu.douban4j.model.common.DoubanLinkObj; import com.google.api.client.util.Key; import java.util.List; /** * * @author Zhibo Wei <uglytroll@dongxuexidu.com> */ public class DoubanNoteFeedObj implements IDoubanObject { @Key private String title; @Key("author") private DoubanAuthorObj author; @Key("link") private List<DoubanLinkObj> links; @Key("opensearch:itemsPerPage") private int itemsPerPage; @Key("opensearch:startIndex") private int startIndex; @Key("entry") private List<DoubanNoteEntryObj> entries; @Override public String getObjName() { return "doubannotefeed"; } /** * @return the title */ public String getTitle() { return title; } /** * @param title the title to set */ public void setTitle(String title) { this.title = title; } /** * @return the author */ public DoubanAuthorObj getAuthor() { return author; } /** * @param author the author to set */ public void setAuthor(DoubanAuthorObj author) { this.author = author; } public void setLinks (List<DoubanLinkObj> links) { this.links = links; } public void addLink(DoubanLinkObj link) { this.links.add(link); } public String getLinkByRel (String rel) { for (DoubanLinkObj obj : this.links) { if (obj.getRel().equalsIgnoreCase(rel)) { return obj.getHref(); } } return null; } public List<DoubanLinkObj> getLinks() { return this.links; } /** * @return the itemsPerPage */ public int getItemsPerPage() { return itemsPerPage; } /** * @param itemsPerPage the itemsPerPage to set */ public void setItemsPerPage(int itemsPerPage) { this.itemsPerPage = itemsPerPage; } /** * @return the startIndex */ public int getStartIndex() { return startIndex; } /** * @param startIndex the startIndex to set */ public void setStartIndex(int startIndex) { this.startIndex = startIndex; } /** * @return the entries */ public List<DoubanNoteEntryObj> getEntries() { return entries; } /** * @param entries the entries to set */ public void setEntries(List<DoubanNoteEntryObj> entries) { this.entries = entries; } }