![JAR search and dependency download from the Maven repository](/logo.png)
com.ryanharter.auto.value.parcel.ParcelAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of auto-value-parcel-adapter Show documentation
Show all versions of auto-value-parcel-adapter Show documentation
AutoValue extension to add Android Parcelable support
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 extends TypeAdapter>> value();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy