com.hazelcast.nio

## Class Address

- java.lang.Object
- - com.hazelcast.nio.Address

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable

      public final class Address
      extends Object
      implements IdentifiedDataSerializable

  Represents an address of a member in the cluster.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Address()`
    `Address(Address address)`
    `Address(InetAddress inetAddress, int port)`
    `Address(InetSocketAddress inetSocketAddress)` Creates a new Address
    `Address(String hostname, InetAddress inetAddress, int port)`
    `Address(String host, int port)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `String` | `getHost()`
    `int` | `getId()` Returns type identifier for this class.
    `InetAddress` | `getInetAddress()`
    `InetSocketAddress` | `getInetSocketAddress()`
    `int` | `getPort()`
    `String` | `getScopedHost()`
    `String` | `getScopeId()`
    `int` | `hashCode()`
    `boolean` | `isIPv4()`
    `boolean` | `isIPv6()`
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `void` | `setScopeId(String scopeId)`
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Address

          public Address()

    - #### Address

          public Address(String host,
                         int port)
                  throws UnknownHostException

      Throws:
        `UnknownHostException`

    - #### Address

          public Address(InetAddress inetAddress,
                         int port)

    - #### Address

          public Address(InetSocketAddress inetSocketAddress)

      Creates a new Address
      Parameters:
        `inetSocketAddress` - the InetSocketAddress to use
      Throws:
        `NullPointerException` - if inetSocketAddress is null
        `IllegalArgumentException` - if the address can't be resolved.

    - #### Address

          public Address(String hostname,
                         InetAddress inetAddress,
                         int port)

    - #### Address

          public Address(Address address)

  - ### Method Detail

    - #### getHost

          public String getHost()

    - #### getPort

          public int getPort()

    - #### getInetAddress

          public InetAddress getInetAddress()
                                     throws UnknownHostException

      Throws:
        `UnknownHostException`

    - #### getInetSocketAddress

          public InetSocketAddress getInetSocketAddress()
                                                 throws UnknownHostException

      Throws:
        `UnknownHostException`

    - #### isIPv4

          public boolean isIPv4()

    - #### isIPv6

          public boolean isIPv6()

    - #### getScopeId

          public String getScopeId()

    - #### setScopeId

          public void setScopeId(String scopeId)

    - #### getScopedHost

          public String getScopedHost()

    - #### getFactoryId

          public int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2019. All rights reserved.