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

com.ryanharter.auto.value.parcel.ParcelAdapter Maven / Gradle / Ivy

There is a newer version: 0.2.9
Show newest version
package com.ryanharter.auto.value.parcel;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.SOURCE;

/**
 * An annotation that indicates the auto-value-parcel {@link TypeAdapter} to use to
 * parcel and unparcel the field.  The value must be set to a valid {@link TypeAdapter}
 * class.
 *
 * 
 * 
 * {@literal @}AutoValue public abstract class Foo extends Parcelable {
 *   {@literal @}ParcelAdapter(DateTypeAdapter.class) public abstract Date date();
 * }
 * 
 * 
* * The generated code will instantiate and use the {@code DateTypeAdapter} class to parcel and * unparcel the {@code date()} property. In order for the generated code to instantiate the * {@link TypeAdapter}, it needs a public, no-arg constructor. */ @Target(METHOD) @Retention(SOURCE) @Documented public @interface ParcelAdapter { Class> value(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy