Java Code Examples for android.os.Parcel#readValue()

The following examples show how to use android.os.Parcel#readValue() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: AndroidUnplash   File: Result.java    License: MIT License 6 votes vote down vote up
@SuppressWarnings({
    "unchecked"
})
public Result createFromParcel(Parcel in) {
    Result instance = new Result();
    instance.id = ((String) in.readValue((String.class.getClassLoader())));
    instance.createdAt = ((String) in.readValue((String.class.getClassLoader())));
    instance.updatedAt = ((String) in.readValue((String.class.getClassLoader())));
    instance.width = ((Integer) in.readValue((Integer.class.getClassLoader())));
    instance.height = ((Integer) in.readValue((Integer.class.getClassLoader())));
    instance.color = ((String) in.readValue((String.class.getClassLoader())));
    instance.likes = ((Integer) in.readValue((Integer.class.getClassLoader())));
    instance.likedByUser = ((Boolean) in.readValue((Boolean.class.getClassLoader())));
    instance.user = ((User) in.readValue((User.class.getClassLoader())));
    in.readList(instance.currentUserCollections, (java.lang.Object.class.getClassLoader()));
    instance.urls = ((Urls) in.readValue((Urls.class.getClassLoader())));
    in.readList(instance.categories, (Category.class.getClassLoader()));
    instance.links = ((Links) in.readValue((Links.class.getClassLoader())));
    return instance;
}
 
Example 2
Source Project: openapi-generator   File: FormatTest.java    License: Apache License 2.0 6 votes vote down vote up
FormatTest(Parcel in) {
  integer = (Integer)in.readValue(null);
  int32 = (Integer)in.readValue(null);
  int64 = (Long)in.readValue(null);
  number = (BigDecimal)in.readValue(BigDecimal.class.getClassLoader());
  _float = (Float)in.readValue(null);
  _double = (Double)in.readValue(null);
  string = (String)in.readValue(null);
  _byte = (byte[])in.readValue(null);
  binary = (File)in.readValue(File.class.getClassLoader());
  date = (LocalDate)in.readValue(LocalDate.class.getClassLoader());
  dateTime = (OffsetDateTime)in.readValue(OffsetDateTime.class.getClassLoader());
  uuid = (UUID)in.readValue(UUID.class.getClassLoader());
  password = (String)in.readValue(null);
  bigDecimal = (BigDecimal)in.readValue(BigDecimal.class.getClassLoader());
}
 
Example 3
Source Project: fingen   File: Department.java    License: Apache License 2.0 5 votes vote down vote up
protected Department(Parcel in) {
    super(in);
    this.mName = in.readString();
    this.mIsActive = (Boolean) in.readValue(Boolean.class.getClassLoader());
    this.mParentID = in.readLong();
    this.mOrderNum = in.readInt();
    this.mExpanded = in.readByte() != 0;
}
 
Example 4
Source Project: trust   File: LockPatternView.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Constructor called from {@link #CREATOR}
 */
private SavedState(Parcel in) {
    super(in);
    mSerializedPattern = in.readString();
    mDisplayMode = in.readInt();
    mInputEnabled = (Boolean) in.readValue(null);
    mInStealthMode = (Boolean) in.readValue(null);
    mTactileFeedbackEnabled = (Boolean) in.readValue(null);
}
 
Example 5
Source Project: spotify-web-api-android   File: Artist.java    License: MIT License 5 votes vote down vote up
protected Artist(Parcel in) {
    super(in);
    this.followers = in.readParcelable(Followers.class.getClassLoader());
    this.genres = in.createStringArrayList();
    this.images = in.createTypedArrayList(Image.CREATOR);
    this.popularity = (Integer) in.readValue(Integer.class.getClassLoader());
}
 
Example 6
Source Project: droidddle   File: Attachment.java    License: Apache License 2.0 5 votes vote down vote up
private Attachment(Parcel in) {
    this.id = (Long) in.readValue(Long.class.getClassLoader());
    this.url = in.readString();
    this.thumbnailUrl = in.readString();
    this.size = (Long) in.readValue(Long.class.getClassLoader());
    this.contentType = in.readString();
    this.viewsCount = (Integer) in.readValue(Integer.class.getClassLoader());
    long tmpCreatedAt = in.readLong();
    this.createdAt = tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
}
 
Example 7
Source Project: MHViewer   File: LockPatternView.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Constructor called from {@link #CREATOR}
 */
@SuppressLint("ParcelClassLoader")
private SavedState(Parcel in) {
    super(in);
    mSerializedPattern = in.readString();
    mDisplayMode = in.readInt();
    mInputEnabled = (Boolean) in.readValue(null);
    mInStealthMode = (Boolean) in.readValue(null);
    mTactileFeedbackEnabled = (Boolean) in.readValue(null);
}
 
Example 8
Source Project: spotify-web-api-android   File: PlaylistBase.java    License: MIT License 5 votes vote down vote up
protected PlaylistBase(Parcel in) {
    this.collaborative = (Boolean) in.readValue(Boolean.class.getClassLoader());
    this.external_urls = in.readHashMap(Map.class.getClassLoader());
    this.href = (String) in.readValue(String.class.getClassLoader());
    this.id = (String) in.readValue(String.class.getClassLoader());
    this.images = in.createTypedArrayList(Image.CREATOR);
    this.name = (String) in.readValue(String.class.getClassLoader());
    this.owner = in.readParcelable(UserPublic.class.getClassLoader());
    this.is_public = (Boolean) in.readValue(Boolean.class.getClassLoader());
    this.snapshot_id = (String) in.readValue(String.class.getClassLoader());
    this.type = (String) in.readValue(String.class.getClassLoader());
    this.uri = (String) in.readValue(String.class.getClassLoader());
}
 
Example 9
@SuppressWarnings({
        "unchecked"
})
public CoolDetailsResponse createFromParcel(Parcel in) {
    CoolDetailsResponse instance = new CoolDetailsResponse();
    instance.hash = ((String) in.readValue((String.class.getClassLoader())));
    instance.addr = ((String) in.readValue((String.class.getClassLoader())));
    instance.bund = ((String) in.readValue((String.class.getClassLoader())));
    return instance;
}
 
Example 10
Source Project: timecat   File: Dialog.java    License: Apache License 2.0 5 votes vote down vote up
protected Builder(Parcel in) {
    mStyleId = in.readInt();
    mContentViewId = in.readInt();
    mTitle = (CharSequence) in.readValue(null);
    mPositive = (CharSequence) in.readValue(null);
    mNegative = (CharSequence) in.readValue(null);
    mNeutral = (CharSequence) in.readValue(null);

    onReadFromParcel(in);
}
 
Example 11
Source Project: hawkular-android-client   File: Data.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({
    "unchecked"
})
public Data createFromParcel(Parcel in) {
    Data instance = new Data();
    instance.timestamp = ((Long) in.readValue((Integer.class.getClassLoader())));
    instance.value = ((String) in.readValue((String.class.getClassLoader())));
    instance.tags = ((Tags) in.readValue((Tags.class.getClassLoader())));
    return instance;
}
 
Example 12
TypeHolderExample(Parcel in) {
  stringItem = (String)in.readValue(null);
  numberItem = (BigDecimal)in.readValue(BigDecimal.class.getClassLoader());
  floatItem = (Float)in.readValue(null);
  integerItem = (Integer)in.readValue(null);
  boolItem = (Boolean)in.readValue(null);
  arrayItem = (List<Integer>)in.readValue(null);
}
 
Example 13
Source Project: okuki   File: WrappedPlace.java    License: Apache License 2.0 5 votes vote down vote up
private WrappedPlace(Parcel parcel) {
    placeClass = (Class<T>) parcel.readSerializable();
    dataClass = (Class) parcel.readSerializable();
    if (Void.class.equals(dataClass)) {
        data = parcel.readValue(String.class.getClassLoader());
    } else if (Parcelable.class.isAssignableFrom(dataClass)) {
        data = parcel.readParcelable(dataClass.getClassLoader());
    } else if (Serializable.class.isAssignableFrom(dataClass)) {
        data = parcel.readSerializable();
    } else {
        throw new RuntimeException(String.format("Error restoring place %s", placeClass));
    }
}
 
Example 14
Source Project: fingen   File: NestedModelFilter.java    License: Apache License 2.0 5 votes vote down vote up
protected NestedModelFilter(Parcel in) {
    this.mIdList = (HashSet<Long>) in.readSerializable();
    this.mEnabled = (Boolean) in.readValue(Boolean.class.getClassLoader());
    this.mModelType = in.readInt();
    this.mInverted = in.readByte() != 0;
    this.mIncludeChildren = in.readByte() != 0;
    this.mId = in.readLong();
}
 
Example 15
Source Project: JobSchedulerCompat   File: GcmIntentParser.java    License: MIT License 4 votes vote down vote up
/**
 * Iterates over the map looking for the {@link #BUNDLE_KEY_CALLBACK} key to try and read the {@link IBinder}
 * straight from the parcelled data. This is entirely dependent on the implementation of Parcel, but these specific
 * parts of {@link Parcel} / {@link Bundle} haven't changed since 2008 and newer versions of Android will ship
 * with newer versions of Google Play services which embed the IBinder directly into the {@link Bundle}
 * (no need to deal with the {@link android.os.Parcelable} issues).
 */
GcmIntentParser(Bundle data) throws RuntimeException {
    if (data == null) {
        throw new IllegalArgumentException();
    }

    jobId = Integer.valueOf(data.getString(BUNDLE_KEY_TAG));

    extras = data.getBundle(BUNDLE_KEY_EXTRAS);

    triggeredContentUris = data.getParcelableArrayList(BUNDLE_KEY_TRIGGERED_URIS);

    if (triggeredContentUris != null) {
        triggeredContentAuthorities = new ArrayList<>();
        for (Uri triggeredContentUri : triggeredContentUris) {
            triggeredContentAuthorities.add(triggeredContentUri.getAuthority());
        }
    }

    Parcel parcel = toParcel(data);
    try {
        int numEntries = checkNonEmptyBundleHeader(parcel);
        for (int i = 0; i < numEntries; i++) {
            String key = null;
            if (shouldReadKeysAsStrings()) {
                key = parcel.readString();
            } else {
                Object entryKeyObj = parcel.readValue(getClass().getClassLoader());
                if (entryKeyObj instanceof String) {
                    key = (String) entryKeyObj;
                }
            }

            if (key == null) {
                continue;
            }

            if (BUNDLE_KEY_CALLBACK.equals(key)
                    && parcel.readInt() == VAL_PARCELABLE
                    && PENDING_CALLBACK_CLASS.equals(parcel.readString())) {
                callback = parcel.readStrongBinder();
                break;
            }
        }
    } finally {
        parcel.recycle();
    }

    if (extras == null || callback == null) {
        throw new IllegalArgumentException();
    }
}
 
Example 16
Source Project: openapi-generator   File: EnumArrays.java    License: Apache License 2.0 4 votes vote down vote up
EnumArrays(Parcel in) {
  justSymbol = (JustSymbolEnum)in.readValue(null);
  arrayEnum = (List<ArrayEnumEnum>)in.readValue(null);
}
 
Example 17
Source Project: Movie-Check   File: MovieInterest.java    License: Apache License 2.0 4 votes vote down vote up
protected MovieInterest(Parcel in) {
    this.id = (Long) in.readValue(Long.class.getClassLoader());
    this.movie = in.readParcelable(Movie.class.getClassLoader());
    this.user = in.readParcelable(User.class.getClassLoader());
}
 
Example 18
ArrayOfArrayOfNumberOnly(Parcel in) {
  arrayArrayNumber = (List<List<BigDecimal>>)in.readValue(List.class.getClassLoader());
}
 
Example 19
Source Project: openapi-generator   File: CatAllOf.java    License: Apache License 2.0 4 votes vote down vote up
CatAllOf(Parcel in) {
  declawed = (Boolean)in.readValue(null);
}
 
Example 20
public FaceAnalysis(Parcel in) {
    faceRectangle = (FaceRectangle) in.readValue(FaceRectangle.class.getClassLoader());
    scores = (Scores) in.readValue(Scores.class.getClassLoader());
}