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