
org.nameapi.client.services.matcher.personmatcher.PersonMatcherCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nameapi-client Show documentation
Show all versions of nameapi-client Show documentation
Java Client for the NameAPI Web Service.
The newest version!
package org.nameapi.client.services.matcher.personmatcher;
import com.google.common.base.Optional;
import com.optimaize.command4j.ExecutionContext;
import org.jetbrains.annotations.NotNull;
import org.nameapi.client.services.NameApiBaseCommand;
import org.nameapi.ontology5.services.matcher.personmatcher.PersonMatcherResult;
import java.util.concurrent.Callable;
/**
* Compares two people and tells if and how they match.
*/
public class PersonMatcherCommand
extends NameApiBaseCommand
{
private static final String SERVICE_PATH = "/matcher/personmatcher";
public PersonMatcherCommand() {
super(RestPort.class);
}
@Override
public PersonMatcherResult call(@NotNull Optional arg, @NotNull ExecutionContext ec) throws Exception {
return getPort(ec).call(getApiKey(ec), getContext(ec), arg.get().getInputPerson1(), arg.get().getInputPerson2());
}
@NotNull @Override
protected Callable createPort(@NotNull final ExecutionContext ec) {
return new Callable() {
@Override
public RestPort call() throws Exception {
return new RestPort(makeClient(ec), SERVICE_PATH);
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy