Skip to content

Instantly share code, notes, and snippets.

@digitalbuddha
Created April 2, 2016 03:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalbuddha/87c720ff8b3dcae23949046e4028af60 to your computer and use it in GitHub Desktop.
Save digitalbuddha/87c720ff8b3dcae23949046e4028af60 to your computer and use it in GitHub Desktop.
@Value.Immutable
@Value.Style(allParameters = true)
public abstract class Foo implements FooModel{
public static final FooModel.Mapper<Foo> MAPPER = new FooModel.Mapper<>((Mapper.Creator<Foo>) ImmutableFoo::of);
public static final class Marshal extends FooModel.FooMarshal {}
}
@elucash
Copy link

elucash commented Apr 2, 2016

Strangely, it works for me without the cast. Both Javac and ECJ

@Value.Immutable 
@Value.Style(allParameters = true)
public abstract class Foo implements FooModel{
    public static final FooModel.Mapper<Foo> MAPPER = new FooModel.Mapper<>(ImmutableFoo::of);
    public static final class Marshal extends FooModel.FooMarshal {}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment