aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml/docilealligator/infinityforreddit/thing/TrendingSearch.java
blob: dec280fadbc2a2f92f6e421ac3658f30392b6c68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package ml.docilealligator.infinityforreddit.thing;

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

import java.util.ArrayList;

import ml.docilealligator.infinityforreddit.post.Post;

public class TrendingSearch implements Parcelable {
    public String queryString;
    public String displayString;
    public String title;
    public ArrayList<Post.Preview> previews;

    public TrendingSearch(String queryString, String displayString, String title, ArrayList<Post.Preview> previews) {
        this.queryString = queryString;
        this.displayString = displayString;
        this.title = title;
        this.previews = previews;
    }

    protected TrendingSearch(Parcel in) {
        queryString = in.readString();
        displayString = in.readString();
        title = in.readString();
        previews = in.createTypedArrayList(Post.Preview.CREATOR);
    }

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

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

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

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(queryString);
        parcel.writeString(displayString);
        parcel.writeString(title);
        parcel.writeTypedList(previews);
    }
}