jeudi 16 août 2018

lombok @Builder type cast error

I am new in lombok. I am using @Builder pattern of lombok but it return generic of Object type:

@Data
@Builder
public class Schedule<T>
{
    private String frequency;
    private T properties;
}

from calling class:

Abc abc=new Abc();
//other
Schedule<Object> schedule=Schedule.builder().frequency( "ankit" ).properties( abc ).build();

i want result in Schedule<Abc> but getting Schedule<Object>.

Please help. Thanks

Aucun commentaire:

Enregistrer un commentaire