Skip to content

Enhances google auto-value with extension for adding jackson annotations

License

Notifications You must be signed in to change notification settings

dzmitryh/auto-value-jackson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-value-jackson

Extension is based on Google's AutoValue and adds JacksonProperty to every getter in AutoValue class as well as adding JsonCreator to constructor method.

Example:

Before:

package test;
import com.google.auto.value.AutoValue;
import com.dzmitryh.auto.value.jackson.AutoJackson;

@AutoJackson 
@AutoValue 
public abstract class Test {
   public abstract String a();
}

After:

package test;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.lang.Override;
import java.lang.String;

final class AutoValue_Test extends $AutoValue_Test {
    @JsonCreator
    AutoValue_Test(@JsonProperty("a") String a) {
        super(a);
    }
    
    @JsonProperty
    @Override
    public String a() {
    return super.a();
    }
}

About

Enhances google auto-value with extension for adding jackson annotations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages