1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.car.vms; 18 19 import android.annotation.NonNull; 20 import android.os.Parcel; 21 import android.os.Parcelable; 22 23 import com.android.internal.util.DataClass; 24 25 import java.util.Objects; 26 27 /** 28 * Hidden data object used to communicate Vehicle Map Service client tokens and system state on 29 * client registration. 30 * 31 * @hide 32 */ 33 @DataClass( 34 genEqualsHashCode = true, 35 genAidl = true) 36 public class VmsRegistrationInfo implements Parcelable { 37 private @NonNull VmsAvailableLayers mAvailableLayers; 38 private @NonNull VmsSubscriptionState mSubscriptionState; 39 40 41 42 // Code below generated by codegen v1.0.14. 43 // 44 // DO NOT MODIFY! 45 // CHECKSTYLE:OFF Generated code 46 // 47 // To regenerate run: 48 // $ codegen $ANDROID_BUILD_TOP/packages/services/Car/car-lib/src/android/car/vms/VmsRegistrationInfo.java 49 // 50 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 51 // Settings > Editor > Code Style > Formatter Control 52 //@formatter:off 53 54 55 @DataClass.Generated.Member VmsRegistrationInfo( @onNull VmsAvailableLayers availableLayers, @NonNull VmsSubscriptionState subscriptionState)56 public VmsRegistrationInfo( 57 @NonNull VmsAvailableLayers availableLayers, 58 @NonNull VmsSubscriptionState subscriptionState) { 59 this.mAvailableLayers = availableLayers; 60 com.android.internal.util.AnnotationValidations.validate( 61 NonNull.class, null, mAvailableLayers); 62 this.mSubscriptionState = subscriptionState; 63 com.android.internal.util.AnnotationValidations.validate( 64 NonNull.class, null, mSubscriptionState); 65 66 // onConstructed(); // You can define this method to get a callback 67 } 68 69 @DataClass.Generated.Member getAvailableLayers()70 public @NonNull VmsAvailableLayers getAvailableLayers() { 71 return mAvailableLayers; 72 } 73 74 @DataClass.Generated.Member getSubscriptionState()75 public @NonNull VmsSubscriptionState getSubscriptionState() { 76 return mSubscriptionState; 77 } 78 79 @Override 80 @DataClass.Generated.Member equals(@ndroid.annotation.Nullable Object o)81 public boolean equals(@android.annotation.Nullable Object o) { 82 // You can override field equality logic by defining either of the methods like: 83 // boolean fieldNameEquals(VmsRegistrationInfo other) { ... } 84 // boolean fieldNameEquals(FieldType otherValue) { ... } 85 86 if (this == o) return true; 87 if (o == null || getClass() != o.getClass()) return false; 88 @SuppressWarnings("unchecked") 89 VmsRegistrationInfo that = (VmsRegistrationInfo) o; 90 //noinspection PointlessBooleanExpression 91 return true 92 && Objects.equals(mAvailableLayers, that.mAvailableLayers) 93 && Objects.equals(mSubscriptionState, that.mSubscriptionState); 94 } 95 96 @Override 97 @DataClass.Generated.Member hashCode()98 public int hashCode() { 99 // You can override field hashCode logic by defining methods like: 100 // int fieldNameHashCode() { ... } 101 102 int _hash = 1; 103 _hash = 31 * _hash + Objects.hashCode(mAvailableLayers); 104 _hash = 31 * _hash + Objects.hashCode(mSubscriptionState); 105 return _hash; 106 } 107 108 @Override 109 @DataClass.Generated.Member writeToParcel(@onNull Parcel dest, int flags)110 public void writeToParcel(@NonNull Parcel dest, int flags) { 111 // You can override field parcelling by defining methods like: 112 // void parcelFieldName(Parcel dest, int flags) { ... } 113 114 dest.writeTypedObject(mAvailableLayers, flags); 115 dest.writeTypedObject(mSubscriptionState, flags); 116 } 117 118 @Override 119 @DataClass.Generated.Member describeContents()120 public int describeContents() { return 0; } 121 122 /** @hide */ 123 @SuppressWarnings({"unchecked", "RedundantCast"}) 124 @DataClass.Generated.Member VmsRegistrationInfo(@onNull Parcel in)125 protected VmsRegistrationInfo(@NonNull Parcel in) { 126 // You can override field unparcelling by defining methods like: 127 // static FieldType unparcelFieldName(Parcel in) { ... } 128 129 VmsAvailableLayers availableLayers = (VmsAvailableLayers) in.readTypedObject(VmsAvailableLayers.CREATOR); 130 VmsSubscriptionState subscriptionState = (VmsSubscriptionState) in.readTypedObject(VmsSubscriptionState.CREATOR); 131 132 this.mAvailableLayers = availableLayers; 133 com.android.internal.util.AnnotationValidations.validate( 134 NonNull.class, null, mAvailableLayers); 135 this.mSubscriptionState = subscriptionState; 136 com.android.internal.util.AnnotationValidations.validate( 137 NonNull.class, null, mSubscriptionState); 138 139 // onConstructed(); // You can define this method to get a callback 140 } 141 142 @DataClass.Generated.Member 143 public static final @NonNull Parcelable.Creator<VmsRegistrationInfo> CREATOR 144 = new Parcelable.Creator<VmsRegistrationInfo>() { 145 @Override 146 public VmsRegistrationInfo[] newArray(int size) { 147 return new VmsRegistrationInfo[size]; 148 } 149 150 @Override 151 public VmsRegistrationInfo createFromParcel(@NonNull Parcel in) { 152 return new VmsRegistrationInfo(in); 153 } 154 }; 155 156 @DataClass.Generated( 157 time = 1581406323727L, 158 codegenVersion = "1.0.14", 159 sourceFile = "packages/services/Car/car-lib/src/android/car/vms/VmsRegistrationInfo.java", 160 inputSignatures = "private @android.annotation.NonNull android.car.vms.VmsAvailableLayers mAvailableLayers\nprivate @android.annotation.NonNull android.car.vms.VmsSubscriptionState mSubscriptionState\nclass VmsRegistrationInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genAidl=true)") 161 @Deprecated __metadata()162 private void __metadata() {} 163 164 165 //@formatter:on 166 // End of generated code 167 168 } 169