Class TelexData

java.lang.Object
com.isode.dsapi.syntax.TelexData
All Implemented Interfaces:
Comparable<TelexData>

public class TelexData extends Object implements Comparable<TelexData>
This class stores information about a network address in the TELEX format.

This is an immutable class.

Examples:

127.0.0.1

127.0.0.1+19000

localhost+19000

Since:
15.0
Author:
mv
  • Constructor Details

    • TelexData

      public TelexData(String host, int port) throws BadValueException
      Constructor to create an object with the given data.
      Parameters:
      host - Host name.
      port - Port.
      Throws:
      BadValueException - if any of the input is invalid.
    • TelexData

      public TelexData(String str) throws BadValueException
      Constructor to create an object with the given data.
      Parameters:
      str - String representation of a TELEX data.
      Throws:
      BadValueException - if the input is invalid.
    • TelexData

      public TelexData(TelexData telexDataToCopy, String hostName) throws BadValueException
      Constructor to create an object which is a copy of the given object but replaces the host name with the given host name.
      Parameters:
      telexDataToCopy - object to copy, must not be null
      hostName - Host name, must not be null
      Throws:
      BadValueException - if any of the input is invalid.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getHost

      public String getHost()
      Returns the host name of the TELEX data object.
      Returns:
      Host name of the TELEX data.
    • getPort

      public int getPort()
      Returns the port of the TELEX data object.
      Returns:
      Port of the TELEX data.
    • getCanonicalForm

      public TelexData getCanonicalForm()
      The host is converted to lower case.
      Returns:
      canonical form of object.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

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

      public int compareTo(TelexData o)
      Specified by:
      compareTo in interface Comparable<TelexData>