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 static com.android.car.internal.ExcludeFromCodeCoverageGeneratedReport.BOILERPLATE_CODE;
20 
21 import android.annotation.NonNull;
22 import android.os.Parcel;
23 import android.os.Parcelable;
24 
25 import com.android.car.internal.ExcludeFromCodeCoverageGeneratedReport;
26 import com.android.car.internal.util.AnnotationValidations;
27 import com.android.car.internal.util.DataClass;
28 
29 import java.util.Objects;
30 
31 /**
32  * Hidden data object used to communicate Vehicle Map Service client tokens and system state on
33  * client registration.
34  *
35  * @hide
36  */
37 @DataClass(
38         genEqualsHashCode = true,
39         genAidl = true)
40 public class VmsRegistrationInfo implements Parcelable {
41     private @NonNull VmsAvailableLayers mAvailableLayers;
42     private @NonNull VmsSubscriptionState mSubscriptionState;
43 
44 
45 
46     // Code below generated by codegen v1.0.23.
47     //
48     // DO NOT MODIFY!
49     // CHECKSTYLE:OFF Generated code
50     //
51     // To regenerate run:
52     // $ codegen $ANDROID_BUILD_TOP/packages/services/Car/car-lib/src/android/car/vms/VmsRegistrationInfo.java
53     // Added AddedInOrBefore or ApiRequirement Annotation manually
54     //
55     // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
56     //   Settings > Editor > Code Style > Formatter Control
57     //@formatter:off
58 
59 
60     @DataClass.Generated.Member
VmsRegistrationInfo( @onNull VmsAvailableLayers availableLayers, @NonNull VmsSubscriptionState subscriptionState)61     public VmsRegistrationInfo(
62             @NonNull VmsAvailableLayers availableLayers,
63             @NonNull VmsSubscriptionState subscriptionState) {
64         this.mAvailableLayers = availableLayers;
65         AnnotationValidations.validate(
66                 NonNull.class, null, mAvailableLayers);
67         this.mSubscriptionState = subscriptionState;
68         AnnotationValidations.validate(
69                 NonNull.class, null, mSubscriptionState);
70 
71         // onConstructed(); // You can define this method to get a callback
72     }
73 
74     @DataClass.Generated.Member
getAvailableLayers()75     public @NonNull VmsAvailableLayers getAvailableLayers() {
76         return mAvailableLayers;
77     }
78 
79     @DataClass.Generated.Member
getSubscriptionState()80     public @NonNull VmsSubscriptionState getSubscriptionState() {
81         return mSubscriptionState;
82     }
83 
84     @Override
85     @DataClass.Generated.Member
equals(@ndroid.annotation.Nullable Object o)86     public boolean equals(@android.annotation.Nullable Object o) {
87         // You can override field equality logic by defining either of the methods like:
88         // boolean fieldNameEquals(VmsRegistrationInfo other) { ... }
89         // boolean fieldNameEquals(FieldType otherValue) { ... }
90 
91         if (this == o) return true;
92         if (o == null || getClass() != o.getClass()) return false;
93         @SuppressWarnings("unchecked")
94         VmsRegistrationInfo that = (VmsRegistrationInfo) o;
95         //noinspection PointlessBooleanExpression
96         return true
97                 && Objects.equals(mAvailableLayers, that.mAvailableLayers)
98                 && Objects.equals(mSubscriptionState, that.mSubscriptionState);
99     }
100 
101     @Override
102     @DataClass.Generated.Member
hashCode()103     public int hashCode() {
104         // You can override field hashCode logic by defining methods like:
105         // int fieldNameHashCode() { ... }
106 
107         int _hash = 1;
108         _hash = 31 * _hash + Objects.hashCode(mAvailableLayers);
109         _hash = 31 * _hash + Objects.hashCode(mSubscriptionState);
110         return _hash;
111     }
112 
113     @Override
114     @DataClass.Generated.Member
writeToParcel(@onNull Parcel dest, int flags)115     public void writeToParcel(@NonNull Parcel dest, int flags) {
116         // You can override field parcelling by defining methods like:
117         // void parcelFieldName(Parcel dest, int flags) { ... }
118 
119         dest.writeTypedObject(mAvailableLayers, flags);
120         dest.writeTypedObject(mSubscriptionState, flags);
121     }
122 
123     @Override
124     @DataClass.Generated.Member
125     @ExcludeFromCodeCoverageGeneratedReport(reason = BOILERPLATE_CODE)
describeContents()126     public int describeContents() { return 0; }
127 
128     /** @hide */
129     @SuppressWarnings({"unchecked", "RedundantCast"})
130     @DataClass.Generated.Member
VmsRegistrationInfo(@onNull Parcel in)131     protected VmsRegistrationInfo(@NonNull Parcel in) {
132         // You can override field unparcelling by defining methods like:
133         // static FieldType unparcelFieldName(Parcel in) { ... }
134 
135         VmsAvailableLayers availableLayers = (VmsAvailableLayers) in.readTypedObject(VmsAvailableLayers.CREATOR);
136         VmsSubscriptionState subscriptionState = (VmsSubscriptionState) in.readTypedObject(VmsSubscriptionState.CREATOR);
137 
138         this.mAvailableLayers = availableLayers;
139         AnnotationValidations.validate(
140                 NonNull.class, null, mAvailableLayers);
141         this.mSubscriptionState = subscriptionState;
142         AnnotationValidations.validate(
143                 NonNull.class, null, mSubscriptionState);
144 
145         // onConstructed(); // You can define this method to get a callback
146     }
147 
148     @DataClass.Generated.Member
149     public static final @NonNull Parcelable.Creator<VmsRegistrationInfo> CREATOR
150             = new Parcelable.Creator<VmsRegistrationInfo>() {
151         @Override
152         public VmsRegistrationInfo[] newArray(int size) {
153             return new VmsRegistrationInfo[size];
154         }
155 
156         @Override
157         public VmsRegistrationInfo createFromParcel(@NonNull Parcel in) {
158             return new VmsRegistrationInfo(in);
159         }
160     };
161 
162     @DataClass.Generated(
163             time = 1628099251439L,
164             codegenVersion = "1.0.23",
165             sourceFile = "packages/services/Car/car-lib/src/android/car/vms/VmsRegistrationInfo.java",
166             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.car.internal.util.DataClass(genEqualsHashCode=true, genAidl=true)")
167     @Deprecated
__metadata()168     private void __metadata() {}
169 
170 
171     //@formatter:on
172     // End of generated code
173 
174 }
175