1 /* 2 * Copyright (C) 2024 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 package android.nfc; 17 18 import android.annotation.NonNull; 19 import android.os.Parcel; 20 import android.os.Parcelable; 21 22 23 /** @hide */ 24 public final class Entry implements Parcelable { 25 private final byte mType; 26 private final byte mNfceeId; 27 private final String mEntry; 28 private final String mRoutingType; 29 Entry(String entry, byte type, byte nfceeId, String routingType)30 public Entry(String entry, byte type, byte nfceeId, String routingType) { 31 mEntry = entry; 32 mType = type; 33 mNfceeId = nfceeId; 34 mRoutingType = routingType; 35 } 36 getType()37 public byte getType() { 38 return mType; 39 } 40 getNfceeId()41 public byte getNfceeId() { 42 return mNfceeId; 43 } 44 getEntry()45 public String getEntry() { 46 return mEntry; 47 } 48 getRoutingType()49 public String getRoutingType() { 50 return mRoutingType; 51 } 52 53 @Override describeContents()54 public int describeContents() { 55 return 0; 56 } 57 Entry(Parcel in)58 private Entry(Parcel in) { 59 this.mEntry = in.readString(); 60 this.mNfceeId = in.readByte(); 61 this.mType = in.readByte(); 62 this.mRoutingType = in.readString(); 63 } 64 65 public static final @NonNull Parcelable.Creator<Entry> CREATOR = 66 new Parcelable.Creator<Entry>() { 67 @Override 68 public Entry createFromParcel(Parcel in) { 69 return new Entry(in); 70 } 71 72 @Override 73 public Entry[] newArray(int size) { 74 return new Entry[size]; 75 } 76 }; 77 78 @Override writeToParcel(@onNull Parcel dest, int flags)79 public void writeToParcel(@NonNull Parcel dest, int flags) { 80 dest.writeString(mEntry); 81 dest.writeByte(mNfceeId); 82 dest.writeByte(mType); 83 dest.writeString(mRoutingType); 84 } 85 } 86