| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.view.contentcapture; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.annotation.Nullable; |
| 21 |
import android.os.Parcel; |
| 22 |
import android.os.Parcelable; |
| 23 |
|
| 24 |
import java.io.PrintWriter; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public final class ContentCaptureSessionId implements Parcelable { |
| 30 |
|
| 31 |
private final @NonNull int mValue; |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
public ContentCaptureSessionId(@NonNull int value) { |
| 41 |
mValue = value; |
| 42 |
} |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
public int getValue() { |
| 48 |
return mValue; |
| 49 |
} |
| 50 |
|
| 51 |
@Override |
| 52 |
public int hashCode() { |
| 53 |
final int prime = 31; |
| 54 |
int result = 1; |
| 55 |
result = prime * result + mValue; |
| 56 |
return result; |
| 57 |
} |
| 58 |
|
| 59 |
@Override |
| 60 |
public boolean equals(@Nullable Object obj) { |
| 61 |
if (this == obj) return true; |
| 62 |
if (obj == null) return false; |
| 63 |
if (getClass() != obj.getClass()) return false; |
| 64 |
final ContentCaptureSessionId other = (ContentCaptureSessionId) obj; |
| 65 |
if (mValue != other.mValue) return false; |
| 66 |
return true; |
| 67 |
} |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
@Override |
| 76 |
public String toString() { |
| 77 |
return Integer.toString(mValue); |
| 78 |
} |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
public void dump(PrintWriter pw) { |
| 84 |
pw.print(mValue); |
| 85 |
} |
| 86 |
|
| 87 |
@Override |
| 88 |
public int describeContents() { |
| 89 |
return 0; |
| 90 |
} |
| 91 |
|
| 92 |
@Override |
| 93 |
public void writeToParcel(Parcel parcel, int flags) { |
| 94 |
parcel.writeInt(mValue); |
| 95 |
} |
| 96 |
|
| 97 |
public static final @NonNull Parcelable.Creator<ContentCaptureSessionId> CREATOR = |
| 98 |
new Parcelable.Creator<ContentCaptureSessionId>() { |
| 99 |
|
| 100 |
@Override |
| 101 |
@NonNull |
| 102 |
public ContentCaptureSessionId createFromParcel(Parcel parcel) { |
| 103 |
return new ContentCaptureSessionId(parcel.readInt()); |
| 104 |
} |
| 105 |
|
| 106 |
@Override |
| 107 |
@NonNull |
| 108 |
public ContentCaptureSessionId[] newArray(int size) { |
| 109 |
return new ContentCaptureSessionId[size]; |
| 110 |
} |
| 111 |
}; |
| 112 |
} |