blob: 6bcbefb7a353a4260270a67560f1c9ce4ac45c3d (
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
|
package com.mapswithme.maps.bookmarks.data;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class CatalogCustomProperty implements Parcelable
{
@NonNull
private final String mKey;
@NonNull
private final String mLocalizedName;
private final boolean mRequired;
@NonNull
private final List<CatalogCustomPropertyOption> mOptions;
public CatalogCustomProperty(@NonNull String key, @NonNull String localizedName,
boolean required, @NonNull CatalogCustomPropertyOption[] options)
{
mKey = key;
mLocalizedName = localizedName;
mRequired = required;
mOptions = Collections.unmodifiableList(Arrays.asList(options));
}
protected CatalogCustomProperty(Parcel in)
{
mKey = in.readString();
mLocalizedName = in.readString();
mRequired = in.readByte() != 0;
mOptions = in.createTypedArrayList(CatalogCustomPropertyOption.CREATOR);
}
@Override
public void writeToParcel(Parcel dest, int flags)
{
dest.writeString(mKey);
dest.writeString(mLocalizedName);
dest.writeByte((byte) (mRequired ? 1 : 0));
dest.writeTypedList(mOptions);
}
@Override
public int describeContents()
{
return 0;
}
public static final Creator<CatalogCustomProperty> CREATOR = new Creator<CatalogCustomProperty>()
{
@Override
public CatalogCustomProperty createFromParcel(Parcel in)
{
return new CatalogCustomProperty(in);
}
@Override
public CatalogCustomProperty[] newArray(int size)
{
return new CatalogCustomProperty[size];
}
};
@NonNull
public String getKey() { return mKey; }
@NonNull
public String getLocalizedName() { return mLocalizedName; }
public boolean isRequired() { return mRequired; }
@NonNull
public List<CatalogCustomPropertyOption> getOptions() { return mOptions; }
}
|