aboutsummaryrefslogtreecommitdiff
path: root/WordPress/src/main/java/org/wordpress/android/ui/stats/models/InsightsPopularModel.java
blob: 640c96ffaac7ca6b62dcb93328f9bb205197cc19 (plain)
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
package org.wordpress.android.ui.stats.models;

import org.json.JSONObject;

public class InsightsPopularModel extends BaseStatsModel {
    private final int mHighestHour;
    private final int mHighestDayOfWeek;
    private final Double mHighestDayPercent;
    private final Double mHighestHourPercent;
    private String mBlogID;

    public InsightsPopularModel(String blogID, JSONObject response) {
        this.setBlogID(blogID);
        this.mHighestDayOfWeek = response.optInt("highest_day_of_week");
        this.mHighestHour = response.optInt("highest_hour");
        this.mHighestDayPercent = response.optDouble("highest_day_percent");
        this.mHighestHourPercent = response.optDouble("highest_hour_percent");
    }

    public String getBlogID() {
        return mBlogID;
    }

    private void setBlogID(String blogID) {
        this.mBlogID = blogID;
    }

    public int getHighestHour() {
        return mHighestHour;
    }

    public int getHighestDayOfWeek() {
        return mHighestDayOfWeek;
    }

    public Double getHighestDayPercent() {
        return mHighestDayPercent;
    }

    public Double getHighestHourPercent() {
        return mHighestHourPercent;
    }
}