|
| 1 | +package com.ifttt.connect.api; |
| 2 | + |
| 3 | +import android.os.Parcel; |
| 4 | +import android.os.Parcelable; |
| 5 | + |
| 6 | +import java.util.Objects; |
| 7 | + |
| 8 | +public final class CheckBoxValue implements Parcelable { |
| 9 | + public final String label; |
| 10 | + public final String value; |
| 11 | + |
| 12 | + public CheckBoxValue(String label, String value) { |
| 13 | + this.label = label; |
| 14 | + this.value = value; |
| 15 | + } |
| 16 | + |
| 17 | + protected CheckBoxValue(Parcel in) { |
| 18 | + label = in.readString(); |
| 19 | + value = in.readString(); |
| 20 | + } |
| 21 | + |
| 22 | + public static final Creator<CheckBoxValue> CREATOR = new Creator<CheckBoxValue>() { |
| 23 | + @Override |
| 24 | + public CheckBoxValue createFromParcel(Parcel in) { |
| 25 | + return new CheckBoxValue(in); |
| 26 | + } |
| 27 | + |
| 28 | + @Override |
| 29 | + public CheckBoxValue[] newArray(int size) { |
| 30 | + return new CheckBoxValue[size]; |
| 31 | + } |
| 32 | + }; |
| 33 | + |
| 34 | + @Override |
| 35 | + public boolean equals(Object o) { |
| 36 | + if (this == o) return true; |
| 37 | + if (o == null || getClass() != o.getClass()) return false; |
| 38 | + CheckBoxValue that = (CheckBoxValue) o; |
| 39 | + return Objects.equals(label, that.label) && Objects.equals(value, that.value); |
| 40 | + } |
| 41 | + |
| 42 | + @Override |
| 43 | + public int hashCode() { |
| 44 | + return Objects.hash(label, value); |
| 45 | + } |
| 46 | + |
| 47 | + @Override |
| 48 | + public int describeContents() { |
| 49 | + return 0; |
| 50 | + } |
| 51 | + |
| 52 | + @Override |
| 53 | + public void writeToParcel(Parcel dest, int flags) { |
| 54 | + dest.writeString(label); |
| 55 | + dest.writeString(value); |
| 56 | + } |
| 57 | + } |
0 commit comments