Java com.mongodb ServerAddress fields, constructors, methods, implement or subclass

Example usage for Java com.mongodb ServerAddress fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.mongodb ServerAddress.

The text is from its open source code.

Subclass

com.mongodb.ServerAddress has subclasses.
Click this link to see all its subclasses.

Constructor

ServerAddress(final InetAddress inetAddress, final int port)
Creates a ServerAddress
ServerAddress(@Nullable final String host, final int port)
Creates a ServerAddress
ServerAddress(@Nullable final String host)
Creates a ServerAddress with default port
ServerAddress(final InetAddress inetAddress)
Creates a ServerAddress with default port
ServerAddress(final InetSocketAddress inetSocketAddress)
Creates a ServerAddress
ServerAddress()
Creates a ServerAddress with default host and port

Method

StringdefaultHost()
Returns the default database host: "127.0.0.1"
intdefaultPort()
Returns the default database port: 27017
booleanequals(final Object o)
StringgetHost()
Gets the hostname
intgetPort()
Gets the port number
InetSocketAddressgetSocketAddress()
Gets the underlying socket address
booleansameHost(final String hostName)
Determines whether this address is the same as a given host.
StringtoString()