| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.app.time; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.annotation.Nullable; |
| 21 |
import android.annotation.SystemApi; |
| 22 |
import android.os.Parcel; |
| 23 |
import android.os.Parcelable; |
| 24 |
|
| 25 |
import java.util.Objects; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
@SystemApi |
| 33 |
public final class TimeZoneCapabilitiesAndConfig implements Parcelable { |
| 34 |
|
| 35 |
public static final @NonNull Creator<TimeZoneCapabilitiesAndConfig> CREATOR = |
| 36 |
new Creator<TimeZoneCapabilitiesAndConfig>() { |
| 37 |
public TimeZoneCapabilitiesAndConfig createFromParcel(Parcel in) { |
| 38 |
return TimeZoneCapabilitiesAndConfig.createFromParcel(in); |
| 39 |
} |
| 40 |
|
| 41 |
public TimeZoneCapabilitiesAndConfig[] newArray(int size) { |
| 42 |
return new TimeZoneCapabilitiesAndConfig[size]; |
| 43 |
} |
| 44 |
}; |
| 45 |
|
| 46 |
|
| 47 |
@NonNull private final TimeZoneCapabilities mCapabilities; |
| 48 |
@NonNull private final TimeZoneConfiguration mConfiguration; |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
public TimeZoneCapabilitiesAndConfig( |
| 56 |
@NonNull TimeZoneCapabilities capabilities, |
| 57 |
@NonNull TimeZoneConfiguration configuration) { |
| 58 |
this.mCapabilities = Objects.requireNonNull(capabilities); |
| 59 |
this.mConfiguration = Objects.requireNonNull(configuration); |
| 60 |
} |
| 61 |
|
| 62 |
@NonNull |
| 63 |
private static TimeZoneCapabilitiesAndConfig createFromParcel(Parcel in) { |
| 64 |
TimeZoneCapabilities capabilities = in.readParcelable(null, android.app.time.TimeZoneCapabilities.class); |
| 65 |
TimeZoneConfiguration configuration = in.readParcelable(null, android.app.time.TimeZoneConfiguration.class); |
| 66 |
return new TimeZoneCapabilitiesAndConfig(capabilities, configuration); |
| 67 |
} |
| 68 |
|
| 69 |
@Override |
| 70 |
public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 71 |
dest.writeParcelable(mCapabilities, flags); |
| 72 |
dest.writeParcelable(mConfiguration, flags); |
| 73 |
} |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
@NonNull |
| 79 |
public TimeZoneCapabilities getCapabilities() { |
| 80 |
return mCapabilities; |
| 81 |
} |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
@NonNull |
| 87 |
public TimeZoneConfiguration getConfiguration() { |
| 88 |
return mConfiguration; |
| 89 |
} |
| 90 |
|
| 91 |
@Override |
| 92 |
public int describeContents() { |
| 93 |
return 0; |
| 94 |
} |
| 95 |
|
| 96 |
@Override |
| 97 |
public boolean equals(@Nullable Object o) { |
| 98 |
if (this == o) { |
| 99 |
return true; |
| 100 |
} |
| 101 |
if (o == null || getClass() != o.getClass()) { |
| 102 |
return false; |
| 103 |
} |
| 104 |
TimeZoneCapabilitiesAndConfig that = (TimeZoneCapabilitiesAndConfig) o; |
| 105 |
return mCapabilities.equals(that.mCapabilities) |
| 106 |
&& mConfiguration.equals(that.mConfiguration); |
| 107 |
} |
| 108 |
|
| 109 |
@Override |
| 110 |
public int hashCode() { |
| 111 |
return Objects.hash(mCapabilities, mConfiguration); |
| 112 |
} |
| 113 |
|
| 114 |
@Override |
| 115 |
public String toString() { |
| 116 |
return "TimeZoneCapabilitiesAndConfig{" |
| 117 |
+ "mCapabilities=" + mCapabilities |
| 118 |
+ ", mConfiguration=" + mConfiguration |
| 119 |
+ '}'; |
| 120 |
} |
| 121 |
} |