com.algolia.config.Host Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of algoliasearch Show documentation
Show all versions of algoliasearch Show documentation
Java client for Algolia Search API
The newest version!
package com.algolia.config;
import java.util.Set;
import javax.annotation.Nonnull;
public final class Host {
private final String url;
private final int port;
private final Set callTypes;
private final String scheme;
public Host(@Nonnull String url, @Nonnull Set callType) {
this(url, callType, "https");
}
public Host(String url, Set callType, String scheme) {
this(url, callType, scheme, -1);
}
public Host(String url, Set callType, String scheme, int port) {
this.url = url;
this.port = port;
this.callTypes = callType;
this.scheme = scheme;
}
@Nonnull
public String getUrl() {
return url;
}
public int getPort() {
return port;
}
@Nonnull
public Set getCallTypes() {
return callTypes;
}
@Nonnull
public String getScheme() {
return scheme;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Host host = (Host) o;
if (!url.equals(host.url)) return false;
if (port != host.port) return false;
if (!callTypes.equals(host.callTypes)) return false;
return scheme.equals(host.scheme);
}
@Override
public int hashCode() {
int result = url.hashCode();
result = 31 * result + port;
result = 31 * result + callTypes.hashCode();
result = 31 * result + scheme.hashCode();
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy