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

org.nameapi.client.services.nameparser.syntax.NameParserArgument Maven / Gradle / Ivy

There is a newer version: 6.0.0
Show newest version
package org.nameapi.client.services.nameparser.syntax;

import org.jetbrains.annotations.NotNull;
import org.nameapi.ontology5.cremalang.annotation.Immutable;
import org.nameapi.ontology5.cremalang.lang.Preconditions;

import java.util.List;

/**
 * The input for the {@link SyntaxBasedNameParserCommand}.
 */
@Immutable
public class NameParserArgument {

    @NotNull
    private final String nameString;
    @NotNull
    private final List rules;

    public NameParserArgument(@NotNull String nameString, @NotNull List rules) {
        Preconditions.notNullAndNotEmpty(nameString, "nameString");
        if (rules.isEmpty()) throw new IllegalArgumentException("At least one rule is mandatory!");
        this.nameString = nameString;
        this.rules  = rules;
    }

    @NotNull
    public String getNameString() {
        return nameString;
    }

    @NotNull
    public List getRules() {
        return rules;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy