package org.dbpedia.spotlight.common.candidates.array;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static org.dbpedia.spotlight.common.Constants.COMMA;

@Getter
@Setter
@NoArgsConstructor
public class CandidateArrayResourceItem {

    @JsonProperty("@uri")
    @SerializedName("@uri")
    private String uri;

    @JsonProperty("@label")
    @SerializedName("@label")
    private String label;

    @JsonProperty("@contextualScore")
    @SerializedName("@contextualScore")
    private Double contextualScore;

    @JsonProperty("@percentageOfSecondRank")
    @SerializedName("@percentageOfSecondRank")
    private Double percentageOfSecondRank;

    @JsonProperty("@support")
    @SerializedName("@support")
    private String support;

    @JsonProperty("@priorScore")
    @SerializedName("@priorScore")
    private Double priorScore;

    @JsonProperty("@finalScore")
    @SerializedName("@finalScore")
    private Double finalScore;

    @JsonProperty("@types")
    @SerializedName("@types")
    private String types;

    public List<String> typesList() {

        if (types != null && !types.isEmpty()) {
            return Arrays.asList(types.split(COMMA));
        }

        return new ArrayList<>();
    }

}

@@ -1343,47 +1343,169 @@
     
-return Arrays.asList(types.split(COMMA)
+String%5B%5D typesArray = types.split(COMMA);%0A            Arrays.parallelSetAll(typesArray, (i) -%3E typesArray%5Bi%5D.trim());%0A            return Arrays.asList(typesArray
 );%0A 

Removing blank spaces