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

de.malkusch.whoisServerList.api.v1.model.WhoisServer Maven / Gradle / Ivy

package de.malkusch.whoisServerList.api.v1.model;

import java.util.regex.Pattern;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import de.malkusch.whoisServerList.api.v1.adapter.XmlCaseInsensitivePatternAdapter;

/**
 * Whois server.
 *
 * @author [email protected]
 * @see Donations
 */
@XmlAccessorType(XmlAccessType.FIELD)
public final class WhoisServer extends ListObject {

    /**
     * The whois default port.
     */
    public static final int DEFAULT_PORT = 43;

    /**
     * The host.
     */
    @XmlAttribute
    private String host;

    /**
     * The pattern for available domains.
     * This may be null.
     */
    @XmlJavaTypeAdapter(XmlCaseInsensitivePatternAdapter.class)
    private Pattern availablePattern;

    /**
     * Returns the whois server.
     *
     * @return the host, not null
     */
    public String getHost() {
        return host;
    }

    /**
     * Sets the whois server.
     *
     * @param host  the server, not null
     */
    public void setHost(final String host) {
        this.host = host;
    }

    /**
     * Returns the pattern for checking the server response
     * for an available domain.
     *
     * @return the available patter, may be null
     */
    public Pattern getAvailablePattern() {
        return availablePattern;
    }

    /**
     * Sets the pattern for checking the server response for
     * an available domain.
     *
     * @param availablePattern the available pattern, maybe null
     */
    public void setAvailablePattern(final Pattern availablePattern) {
        this.availablePattern = availablePattern;
    }

    @Override
    public String toString() {
        return getHost();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy