All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nameapi.client.services.nameparser.NameParserResult Maven / Gradle / Ivy

There is a newer version: 6.0.0
Show newest version

package org.nameapi.client.services.nameparser;

import com.google.common.base.Optional;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.nameapi.ontology5.cremalang.annotation.Immutable;

import java.util.List;


/**
 */
@Immutable
public class NameParserResult {

    @NotNull
    private final Optional bestMatch;
    @NotNull
    private final List matches;
    private final int shortestItemCount;

    public NameParserResult(@Nullable Match bestMatch, @NotNull List matches, int shortestItemCount) {
        this.bestMatch = Optional.fromNullable(bestMatch);
        this.matches = matches;
        this.shortestItemCount = shortestItemCount;
    }

    @NotNull
    public Optional getBestMatch() {
        return bestMatch;
    }

    @NotNull
    public List getMatches() {
        return matches;
    }

    public int getShortestItemCount() {
        return shortestItemCount;
    }


    @Override
    public String toString() {
        return "ParserResult{" +
                "bestMatch=" + bestMatch +
                ", matches=" + matches +
                ", shortestItemCount=" + shortestItemCount +
                '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy