Class Host

  • All Implemented Interfaces:
    Serializable

    public final class Host
    extends Object
    implements Serializable
    Holds a host name and port.

    XML configuration usage:

    
    <name>(host name)</name>
    <port>(host port)</port>
    Since:
    2.0.0
    Author:
    Pascal Essiembre
    See Also:
    Serialized Form
    • Constructor Detail

      • Host

        public Host​(String name,
                    int port)
    • Method Detail

      • getName

        public String getName()
      • getPort

        public int getPort()
      • isSet

        public boolean isSet()
      • withName

        public Host withName​(String name)
      • withPort

        public Host withPort​(int port)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • loadFromXML

        public static Host loadFromXML​(XML xml,
                                       Host defaultHost)
        Gets a host from an existing XML.
        Parameters:
        xml - the XML to get the host from
        defaultHost - default host if it does not exist in XML
        Returns:
        host
      • saveToXML

        public static void saveToXML​(XML xml,
                                     Host host)
        Adds a host to an existing XML.
        Parameters:
        xml - the XML to add the host to
        host - the host