1 /*
2  * Copyright (C) 2011 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 androidx.core.os;
18 
19 import android.os.Parcel;
20 import android.os.Parcelable;
21 
22 /**
23  * Callbacks a {@link Parcelable} creator should implement.
24  *
25  * @deprecated Use {@link android.os.Parcelable.ClassLoaderCreator} directly.
26  */
27 @Deprecated
28 public interface ParcelableCompatCreatorCallbacks<T> {
29 
30     /**
31      * Create a new instance of the Parcelable class, instantiating it
32      * from the given Parcel whose data had previously been written by
33      * {@link Parcelable#writeToParcel Parcelable.writeToParcel()} and
34      * using the given ClassLoader.
35      *
36      * @param in The Parcel to read the object's data from.
37      * @param loader The ClassLoader that this object is being created in.
38      * @return Returns a new instance of the Parcelable class.
39      */
createFromParcel(Parcel in, ClassLoader loader)40     T createFromParcel(Parcel in, ClassLoader loader);
41 
42     /**
43      * Create a new array of the Parcelable class.
44      *
45      * @param size Size of the array.
46      * @return Returns an array of the Parcelable class, with every entry
47      *         initialized to null.
48      */
newArray(int size)49     T[] newArray(int size);
50 }
51