All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.workday.postman.adapter.CharParcelableAdapter Maven / Gradle / Ivy

Go to download

A java library that uses code generation to handle the details of implementing the Parcelable interface on Android.

There is a newer version: 1.3
Show newest version
/*
 * Copyright 2015 Workday, Inc.
 *
 * This software is available under the MIT license.
 * Please see the LICENSE.txt file in this project.
 */

package com.workday.postman.adapter;

import android.os.Parcel;

/**
 * @author Nathan Taylor
 * @since 2015-04-26
 */
public class CharParcelableAdapter implements ParcelableAdapter {

    private final Character value;

    public CharParcelableAdapter(Character value) {
        this.value = value;
    }

    public static final Creator CREATOR =
            new Creator() {


                @Override
                public CharParcelableAdapter createFromParcel(Parcel source) {
                    return new CharParcelableAdapter((char) source.readInt());
                }

                @Override
                public CharParcelableAdapter[] newArray(int size) {
                    return new CharParcelableAdapter[size];
                }
            };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(value);
    }

    @Override
    public Character getValue() {
        return value;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy