Android Open Source - epgreader-android E P G Link Item






From Project

Back to project page epgreader-android.

License

The source code is released under:

Apache License

If you think the Android project epgreader-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.jeffpalm.android.epg;
//ww w . ja v  a2s .  c  o m
import java.util.ArrayList;
import java.util.List;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * A POJO for the <link_item> node.
 */
public final class EPGLinkItem extends AbstractEPGNode implements EPGNode {

  private final String category;
  private final String name;
  private final String description;
  private final String thumbnail;
  private final String shareUrl;
  private final String url;
  private final String id;
  private final List<EPGContent> contents;

  public static Builder builder() {
    return new Builder();
  }

  private EPGLinkItem(String category, String name, String description, String thumbnail,
      String shareUrl, String url, String id, List<EPGContent> contents) {
    this.category = category;
    this.name = name;
    this.description = description;
    this.thumbnail = thumbnail;
    this.shareUrl = shareUrl;
    this.url = url;
    this.id = id;
    this.contents = contents;
  }

  public List<EPGContent> getContents() {
    return contents;
  }

  @Override
  public String getId() {
    return id;
  }

  public String getCategory() {
    return category;
  }

  @Override
  public String getName() {
    return name;
  }

  public String getDescription() {
    return description;
  }

  public String getShareUrl() {
    return shareUrl;
  }

  public String getThumbnail() {
    return thumbnail;
  }

  public String getUrl() {
    return url;
  }

  @Override
  public int hashCode() {
    return hashCode(category) + hashCode(name) + hashCode(description) + hashCode(thumbnail)
        + hashCode(shareUrl) + hashCode(url) + hashCode(id) + hashCode(contents);
  }

  @Override
  public boolean equals(Object o) {
    if (!(o instanceof EPGLinkItem)) {
      return false;
    }
    EPGLinkItem that = (EPGLinkItem) o;
    return equalsOrNull(this.category, that.category) && equalsOrNull(this.name, that.name)
        && equalsOrNull(this.description, that.description)
        && equalsOrNull(this.thumbnail, that.thumbnail)
        && equalsOrNull(this.shareUrl, that.shareUrl) && equalsOrNull(this.url, that.url)
        && equalsOrNull(this.id, that.id) && equalsOrNull(this.contents, that.contents);
  }

  public static class Builder {
    private String category;
    private String name;
    private String description;
    private String thumbnail;
    private String shareUrl;
    private String url;
    private String id;
    private List<EPGContent> contents = new ArrayList<EPGContent>();

    public EPGLinkItem build() {
      return new EPGLinkItem(category, name, description, thumbnail, shareUrl, url, id, contents);
    }

    public Builder withCategory(String category) {
      this.category = category;
      return this;
    }

    public Builder withName(String name) {
      this.name = name;
      return this;
    }

    public Builder withDescription(String description) {
      this.description = description;
      return this;
    }

    public Builder withThumbnail(String thumbnail) {
      this.thumbnail = thumbnail;
      return this;
    }

    public Builder withLink(String link) {
      this.shareUrl = link;
      return this;
    }

    public Builder withUrl(String url) {
      this.url = url;
      return this;
    }

    public Builder withId(String id) {
      this.id = id;
      return this;
    }

    public Builder withContent(EPGContent content) {
      contents.add(content);
      return this;
    }
  }

  // -----------------------------------------------------------------------
  // Parcelable
  // -----------------------------------------------------------------------

  public EPGLinkItem(Parcel in) {
    this.category = in.readString();
    this.name = in.readString();
    this.description = in.readString();
    this.thumbnail = in.readString();
    this.shareUrl = in.readString();
    this.url = in.readString();
    this.id = in.readString();
    this.contents = new ArrayList<EPGContent>();
    in.readList(contents, getClass().getClassLoader());
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(category);
    dest.writeString(name);
    dest.writeString(description);
    dest.writeString(thumbnail);
    dest.writeString(shareUrl);
    dest.writeString(url);
    dest.writeString(id);
    dest.writeList(contents);
  }

  @SuppressWarnings("rawtypes")
  public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
    public EPGContent createFromParcel(Parcel in) {
      return new EPGContent(in);
    }

    public EPGContent[] newArray(int size) {
      return new EPGContent[size];
    }
  };

}




Java Source Code List

com.example.android.imagedownloader.ImageDownloader.java
com.jeffpalm.android.epg.AbstractEPGItem.java
com.jeffpalm.android.epg.AbstractEPGNode.java
com.jeffpalm.android.epg.EPGContentTest.java
com.jeffpalm.android.epg.EPGContent.java
com.jeffpalm.android.epg.EPGIndexTest.java
com.jeffpalm.android.epg.EPGIndex.java
com.jeffpalm.android.epg.EPGItemTestCase.java
com.jeffpalm.android.epg.EPGItem.java
com.jeffpalm.android.epg.EPGLinkItemTest.java
com.jeffpalm.android.epg.EPGLinkItem.java
com.jeffpalm.android.epg.EPGNode.java
com.jeffpalm.android.epg.EPGParserTest.java
com.jeffpalm.android.epg.EPGParser.java
com.jeffpalm.android.epg.EPGSectionTest.java
com.jeffpalm.android.epg.EPGSection.java
com.jeffpalm.android.epg.EPGTestUtil.java
com.jeffpalm.android.epg.EPG.java
com.jeffpalm.android.epg.app.DefaultOnActivityCreatedNotifier.java
com.jeffpalm.android.epg.app.EPGApplication.java
com.jeffpalm.android.epg.app.EPGReaderConstants.java
com.jeffpalm.android.epg.app.EPGReaderFragment.java
com.jeffpalm.android.epg.app.EPGReaderItemListFragment.java
com.jeffpalm.android.epg.app.EPGReaderPreferencesActivity.java
com.jeffpalm.android.epg.app.EPGReaderSharedPrefs.java
com.jeffpalm.android.epg.app.EPGReaderUrlFinder.java
com.jeffpalm.android.epg.app.EPGReaderUtil.java
com.jeffpalm.android.epg.app.Feature.java
com.jeffpalm.android.epg.app.FeedLoader.java
com.jeffpalm.android.epg.app.HeaderFragment.java
com.jeffpalm.android.epg.app.ItemListActivity.java
com.jeffpalm.android.epg.app.ItemListAdapter.java
com.jeffpalm.android.epg.app.ItemListFragment.java
com.jeffpalm.android.epg.app.NoContentFragment.java
com.jeffpalm.android.epg.app.OnActivityCreatedNotifier.java
com.jeffpalm.android.epg.app.PhotoGalleryAdapter.java
com.jeffpalm.android.epg.app.PhotoGalleryFragment.java
com.jeffpalm.android.epg.app.PhotoItemFragment.java
com.jeffpalm.android.epg.app.VideoItemFragment.java
com.jeffpalm.android.epg.app.WebItemFragment.java
com.jeffpalm.android.tmz.model.AbstractTMZItem.java
com.jeffpalm.android.tmz.model.AbstractTMZNode.java
com.jeffpalm.android.tmz.model.DefaultTMZAdapter.java
com.jeffpalm.android.tmz.model.TMZAdapter.java
com.jeffpalm.android.tmz.model.TMZContentCache.java
com.jeffpalm.android.tmz.model.TMZContentTest.java
com.jeffpalm.android.tmz.model.TMZContent.java
com.jeffpalm.android.tmz.model.TMZFactoryHelper.java
com.jeffpalm.android.tmz.model.TMZFactoryHolder.java
com.jeffpalm.android.tmz.model.TMZFactoryTest.java
com.jeffpalm.android.tmz.model.TMZFactory.java
com.jeffpalm.android.tmz.model.TMZIndexTest.java
com.jeffpalm.android.tmz.model.TMZIndexWrapperTest.java
com.jeffpalm.android.tmz.model.TMZIndexWrapper.java
com.jeffpalm.android.tmz.model.TMZIndex.java
com.jeffpalm.android.tmz.model.TMZItemTestCase.java
com.jeffpalm.android.tmz.model.TMZItem.java
com.jeffpalm.android.tmz.model.TMZLinkItemTest.java
com.jeffpalm.android.tmz.model.TMZLinkItem.java
com.jeffpalm.android.tmz.model.TMZNode.java
com.jeffpalm.android.tmz.model.TMZSectionTest.java
com.jeffpalm.android.tmz.model.TMZSection.java
com.jeffpalm.android.tmz.model.TMZTestCase.java
com.jeffpalm.android.tmz.model.TMZTestUtil.java
com.jeffpalm.android.tmz.model.TMZTest.java
com.jeffpalm.android.tmz.model.TMZWrapperTest.java
com.jeffpalm.android.tmz.model.TMZWrapper.java
com.jeffpalm.android.tmz.model.TMZ.java
com.jeffpalm.android.util.Asserts.java
com.jeffpalm.android.util.ExpandableValueTest.java
com.jeffpalm.android.util.ExpandableValue.java
com.jeffpalm.android.util.ShiftSetTest.java
com.jeffpalm.android.util.ShiftSet.java
com.jeffpalm.android.util.TMZUrlFinderTest.java
com.jeffpalm.android.util.UtilTest.java
com.jeffpalm.android.util.Util.java
com.jeffpalm.android.util.urls.DatabaseHandler.java
com.jeffpalm.android.util.urls.DatabaseHelper.java
com.jeffpalm.android.util.urls.StringInputStream.java
com.jeffpalm.android.util.urls.URLCache.java
com.jeffpalm.android.util.urls.WriteToDatabaseOnCloseInputStream.java