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

mServer.crawler.sender.newsearch.ZDFConfigurationDTO Maven / Gradle / Ivy

There is a newer version: 3.1.64
Show newest version
package mServer.crawler.sender.newsearch;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * A Data-Transfer-Object to transfer the ZDF configuration information.
 */
public class ZDFConfigurationDTO implements Serializable {
    private static final long serialVersionUID = -445386435734116784L;
    private final Map apiToken = new HashMap<>();

    public String getApiToken(ZDFClient.ZDFClientMode aClientMode) {
        return apiToken.getOrDefault(aClientMode, "");
    }

    public void setApiToken(ZDFClient.ZDFClientMode aClientMode, final String aApiToken) {
        apiToken.put(aClientMode, aApiToken);
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        final ZDFConfigurationDTO that = (ZDFConfigurationDTO) o;

        return getApiToken(ZDFClient.ZDFClientMode.SEARCH) != null ? getApiToken(ZDFClient.ZDFClientMode.SEARCH).equals(that.getApiToken(ZDFClient.ZDFClientMode.SEARCH)) : that.getApiToken(ZDFClient.ZDFClientMode.SEARCH) == null;
    }

    @Override
    public int hashCode() {
        return getApiToken(ZDFClient.ZDFClientMode.SEARCH) != null ? getApiToken(ZDFClient.ZDFClientMode.SEARCH).hashCode() : 0;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy