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

CatalogTag.java « data « bookmarks « maps « mapswithme « com « src « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e44e7114f6c09911b1d55b0dd57dbfa243a38839 (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
package com.mapswithme.maps.bookmarks.data;

import android.graphics.Color;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;

public class CatalogTag implements Parcelable
{
  @NonNull
  private final String mId;

  @NonNull
  private final String mLocalizedName;

  private final int mColor;

  public CatalogTag(@NonNull String id, @NonNull String localizedName, float r, float g, float b)
  {
    mId = id;
    mLocalizedName = localizedName;
    mColor = Color.rgb((int)(r * 255), (int)(g * 255), (int)(b * 255));
  }

  @NonNull
  public String getId() { return mId; }

  @NonNull
  public String getLocalizedName() { return mLocalizedName; }

  public int getColor() { return mColor; }

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

  @Override
  public void writeToParcel(Parcel dest, int flags)
  {
    dest.writeString(this.mId);
    dest.writeString(this.mLocalizedName);
    dest.writeInt(this.mColor);
  }

  protected CatalogTag(Parcel in)
  {
    this.mId = in.readString();
    this.mLocalizedName = in.readString();
    this.mColor = in.readInt();
  }

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

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

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

  @Override
  public int hashCode()
  {
    return mId.hashCode();
  }

  @Override
  public String toString()
  {
    final StringBuilder sb = new StringBuilder("CatalogTag{");
    sb.append("mId='").append(mId).append('\'');
    sb.append(", mLocalizedName='").append(mLocalizedName).append('\'');
    sb.append('}');
    return sb.toString();
  }
}