Skip to content

An Auto Value Extension that allows minimal setup of Auto Value classes when using Jackson

Notifications You must be signed in to change notification settings

bgogetap/AutoJackson

Repository files navigation

Download Build Status

AutoJackson

An Auto Value Extension that allows minimal setup of Auto Value classes when using Jackson

To use, annotate your @AutoValue class with @JsonDeserialize(builder = AutoValue_{YourClass}.Builder.class) Include only the abstract methods in your class body. The Builder class will be generated for you.

Example:

    @AutoValue
    @JsonDeserialize(builder = AutoValue_Response.Builder.class)
    public abstract class Response {

        @JsonProperty("id")
        public abstract Long id();

        @JsonProperty("name")
        public abstract String name();
    }

Annotating the abstract methods with @JsonProperty is optional. If left out, the annotation will be added for you in the Builder class using the method name as the value.

Setup

buildscript {
    repositories {
        jcenter()
    }
}

dependencies {
    apt 'com.brandongogetap:auto-jackson:0.1'
}

(Using the android-apt plugin)

About

An Auto Value Extension that allows minimal setup of Auto Value classes when using Jackson

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages