Welcome to mirror list, hosted at ThFree Co, Russian Federation.

LocalExpert.java « discovery « maps « mapswithme « com « src « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7f26cc61048813bfcdb94829012886825eec251f (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
package com.mapswithme.maps.discovery;

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

import android.support.annotation.NonNull;

public final class LocalExpert implements Parcelable
{
  private final int mId;
  @NonNull
  private final String mName;
  @NonNull
  private final String mCountry;
  @NonNull
  private final String mCity;
  private final double mRating;
  private final int mReviewCount;
  private final double mPrice;
  @NonNull
  private final String mCurrency;
  @NonNull
  private final String mMotto;
  @NonNull
  private final String mAboutExpert;
  @NonNull
  private final String mOfferDescription;
  @NonNull
  private final String mPageUrl;
  @NonNull
  private final String mPhotoUrl;


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

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

  @SuppressWarnings("unused")
  public LocalExpert(int id, @NonNull String name, @NonNull String country,
                     @NonNull String city, double rating, int reviewCount,
                     double price, @NonNull String currency, @NonNull String motto,
                     @NonNull String about, @NonNull String offer, @NonNull String pageUrl,
                     @NonNull String photoUrl)
  {
    mId = id;
    mName = name;
    mCountry = country;
    mCity = city;
    mRating = rating;
    mReviewCount = reviewCount;
    mPrice = price;
    mCurrency = currency;
    mMotto = motto;
    mAboutExpert = about;
    mOfferDescription = offer;
    mPhotoUrl = photoUrl;
    mPageUrl = pageUrl;
  }

  private LocalExpert(Parcel in)
  {
    mId = in.readInt();
    mName = in.readString();
    mCountry = in.readString();
    mCity = in.readString();
    mRating = in.readDouble();
    mReviewCount = in.readInt();
    mPrice = in.readDouble();
    mCurrency = in.readString();
    mMotto = in.readString();
    mAboutExpert = in.readString();
    mOfferDescription = in.readString();
    mPhotoUrl = in.readString();
    mPageUrl = in.readString();
  }

  @Override
  public void writeToParcel(Parcel dest, int flags)
  {
    dest.writeInt(mId);
    dest.writeString(mName);
    dest.writeString(mCountry);
    dest.writeString(mCity);
    dest.writeDouble(mRating);
    dest.writeInt(mReviewCount);
    dest.writeDouble(mPrice);
    dest.writeString(mCurrency);
    dest.writeString(mMotto);
    dest.writeString(mAboutExpert);
    dest.writeString(mOfferDescription);
    dest.writeString(mPhotoUrl);
    dest.writeString(mPageUrl);
  }

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

  int getId() { return mId; }

  @NonNull
  public String getName() { return mName; }

  @NonNull
  String getCountry() { return mCountry; }

  @NonNull
  String getCity() { return mCity; }

  public double getRating() { return mRating; }

  int getReviewCount() { return mReviewCount; }

  public double getPrice() { return mPrice; }

  @NonNull
  public String getCurrency() { return mCurrency; }

  @NonNull
  String getMotto() { return mMotto; }

  @NonNull
  String getAboutExpert() { return mAboutExpert; }

  @NonNull
  String getOfferDescription() { return mOfferDescription; }

  @NonNull
  public String getPageUrl() { return mPageUrl;}

  @NonNull
  public String getPhotoUrl() { return mPhotoUrl; }

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

    LocalExpert that = (LocalExpert) o;

    if (mId != that.mId) return false;
    if (Double.compare(that.mRating, mRating) != 0) return false;
    if (mReviewCount != that.mReviewCount) return false;
    if (Double.compare(that.mPrice, mPrice) != 0) return false;
    if (!mName.equals(that.mName)) return false;
    if (!mCountry.equals(that.mCountry)) return false;
    if (!mCity.equals(that.mCity)) return false;
    if (!mCurrency.equals(that.mCurrency)) return false;
    if (!mMotto.equals(that.mMotto)) return false;
    if (!mAboutExpert.equals(that.mAboutExpert)) return false;
    if (!mOfferDescription.equals(that.mOfferDescription)) return false;
    if (!mPageUrl.equals(that.mPageUrl)) return false;
    return mPhotoUrl.equals(that.mPhotoUrl);
  }

  @Override
  public int hashCode()
  {
    int result;
    long temp;
    result = mId;
    result = 31 * result + mName.hashCode();
    result = 31 * result + mCountry.hashCode();
    result = 31 * result + mCity.hashCode();
    temp = Double.doubleToLongBits(mRating);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    result = 31 * result + mReviewCount;
    temp = Double.doubleToLongBits(mPrice);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    result = 31 * result + mCurrency.hashCode();
    result = 31 * result + mMotto.hashCode();
    result = 31 * result + mAboutExpert.hashCode();
    result = 31 * result + mOfferDescription.hashCode();
    result = 31 * result + mPageUrl.hashCode();
    result = 31 * result + mPhotoUrl.hashCode();
    return result;
  }
}