Android Open Source - rss-parser Enclosure






From Project

Back to project page rss-parser.

License

The source code is released under:

Copyright (c) 2014 Artem Gapchenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the So...

If you think the Android project rss-parser 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 aga.rssparser.model;
//from www  . j  av  a  2s  .co m
import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author artem
 * Created on 27.08.14.
 */
@SuppressWarnings("UnusedDeclaration")
public class Enclosure implements Parcelable {
    public String mUrl;
    public String mType;
    public int mLength;

    public static final Creator<Enclosure> CREATOR = new Creator<Enclosure>() {
        @Override
        public Enclosure createFromParcel(Parcel source) {
            return new Enclosure(source);
        }

        @Override
        public Enclosure[] newArray(int size) {
            return new Enclosure[size];
        }
    };

    public Enclosure(final Parcel source) {
        mUrl = source.readString();
        mType = source.readString();
        mLength = source.readInt();
    }

    public Enclosure(final Builder builder) {
        mUrl = builder.getUrl();
        mType = builder.getType();
        mLength = builder.getLength();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(mUrl);
        dest.writeString(mType);
        dest.writeInt(mLength);
    }

    public String getUrl() {
        return mUrl;
    }

    public String getType() {
        return mType;
    }

    public int getLength() {
        return mLength;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || ((Object) this).getClass() != o.getClass()) return false;

        final Enclosure enclosure = (Enclosure) o;

        return mLength == enclosure.mLength && mType.equals(enclosure.mType) && mUrl.equals(enclosure.mUrl);
    }

    @Override
    public int hashCode() {
        int result = mUrl.hashCode();
        result = 31 * result + mType.hashCode();
        result = 31 * result + mLength;
        return result;
    }

    public static class Builder extends FieldTypeAware {
        public String mUrl;
        public String mType;
        public int mLength;

        public String getUrl() {
            return mUrl;
        }

        public void setUrl(String url) {
            mUrl = url;
        }

        public String getType() {
            return mType;
        }

        public void setType(String type) {
            mType = type;
        }

        public int getLength() {
            return mLength;
        }

        public void setLength(int length) {
            mLength = length;
        }
   }
}




Java Source Code List

aga.rssparser.RSSReadException.java
aga.rssparser.RSSReader.java
aga.rssparser.Utils.java
aga.rssparser.model.Enclosure.java
aga.rssparser.model.FieldTypeAware.java
aga.rssparser.model.RSSChannel.java
aga.rssparser.model.RSSItem.java
aga.rssparser.sample.MainActivity.java
aga.rssparser.sample.RSSItemAdapter.java
aga.rssparser.sample.ViewHolder.java