package org.jboss.da.reports.model.response;

import org.jboss.da.listings.model.rest.RestProductInput;
import org.jboss.da.model.rest.GAV;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;

@AllArgsConstructor
public class LookupReport {

    /*
     * Manually unwrap 'gav' via getters so as not to confuse Swagger.
     * 
     * Also, use @JsonIgnore so that the getters and setters generated for 'gav' are also ignored by Jackson.
     */
    @Getter(onMethod = @__({ @JsonIgnore }))
    @Setter(onMethod = @__({ @JsonIgnore }))
    @NonNull
    @JsonIgnore
    private GAV gav;

    @Getter
    @Setter
    private String bestMatchVersion;

    @Getter
    @Setter
    private List<String> availableVersions;

    @Getter
    @Setter
    private boolean blacklisted;

    @Getter
    @Setter
    private List<RestProductInput> whitelisted;

    public LookupReport(GAV gav) {
        this.gav = gav;
    }

    // **************************************************************************
    // Keep `getGroupId`, `getArtifactId`, and `getVersion` here for Swagger,
    // and so that Jackson knows how to marshall 'gav' properly!
    // **************************************************************************
    public String getGroupId() {
        return gav.getGroupId();
    }

    public String getArtifactId() {
        return gav.getArtifactId();
    }

    public String getVersion() {
        return gav.getVersion();
    }
}

@@ -570,98 +570,8 @@
  */%0A
-    @Getter(onMethod = @__(%7B @JsonIgnore %7D))%0A    @Setter(onMethod = @__(%7B @JsonIgnore %7D))%0A
     
@@ -1475,11 +1475,184 @@
 );%0A    %7D
+%0A%0A    @JsonIgnore%0A    public @NonNull GAV getGav() %7B%0A        return this.gav;%0A    %7D%0A%0A    @JsonIgnore%0A    public void setGav(@NonNull GAV gav) %7B%0A        this.gav = gav;%0A    %7D
 %0A%7D%0A

Remove lombok experimental onMethod as it behaves wird on different JDK