Top Description Inners Fields Constructors Methods
java.net

public final Class UnixDomainSocketAddress

extends SocketAddress
Class Inheritance
Imports
java.io.ObjectStreamException, .Serializable, java.net.SocketAddress, java.nio.channels.SocketChannel, java.nio.file.FileSystem, .FileSystems, .InvalidPathException, .Path

A Unix domain socket address. A Unix domain socket address encapsulates a file-system path that Unix domain sockets bind or connect to.

An unnamed UnixDomainSocketAddress has an empty path. The local address of a SocketChannel to a Unix domain socket that is automatically or implicitly bound will be unnamed.

Path objects used to create instances of this class must be obtained from the system-default file system.

Since
16
See Also
java.nio.channels.SocketChannel, java.nio.channels.ServerSocketChannel

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
UnixDomainSocketAddress.Ser

A serial proxy for all UnixDomainSocketAddress instances.

Field Summary

Modifier and TypeField and Description
private final transient Path
pack-priv static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the path fields are equal
equals
(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Compares this address with another object.

public Path

Returns:

this address's path
getPath
()

Returns this address's path.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code of this UnixDomainSocketAddress

public static UnixDomainSocketAddress

Returns:

A UnixDomainSocketAddress
of
(String
The path string, which can be empty
pathname
)

Creates a UnixDomainSocketAddress from the given path string.

public static UnixDomainSocketAddress

Returns:

A UnixDomainSocketAddress
of
(Path
The path to the socket, which can be empty
path
)

Creates a UnixDomainSocketAddress for the given path.

private void
readObject(ObjectInputStream
the stream
s
)

Throws InvalidObjectException, always.

private void
readObjectNoData()

Throws InvalidObjectException, always.

public String

Returns:

this address's path which may be empty for an unnamed address
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this UnixDomainSocketAddress.

private Object

Returns:

a Ser representing the path name of this instance
writeReplace
()

Returns a Ser containing the path name of this instance.

Field Detail

pathback to summary
private final transient Path path
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides java.net.SocketAddress.serialVersionUID.

Annotations
@Serial

Constructor Detail

UnixDomainSocketAddressback to summary
private UnixDomainSocketAddress(Path path)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Compares this address with another object.

Parameters
o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

true if the path fields are equal

Annotations
@Override
getPathback to summary
public Path getPath()

Returns this address's path.

Returns:Path

this address's path

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code of this UnixDomainSocketAddress

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object

Annotations
@Override
ofback to summary
public static UnixDomainSocketAddress of(String pathname)

Creates a UnixDomainSocketAddress from the given path string.

Parameters
pathname:String

The path string, which can be empty

Returns:UnixDomainSocketAddress

A UnixDomainSocketAddress

Exceptions
InvalidPathException:
If the path cannot be converted to a Path
NullPointerException:
if pathname is null
ofback to summary
public static UnixDomainSocketAddress of(Path path)

Creates a UnixDomainSocketAddress for the given path.

Parameters
path:Path

The path to the socket, which can be empty

Returns:UnixDomainSocketAddress

A UnixDomainSocketAddress

Exceptions
IllegalArgumentException:
If the path is not associated with the default file system
NullPointerException:
if path is null
readObjectback to summary
private void readObject(ObjectInputStream s) throws InvalidObjectException

Throws InvalidObjectException, always.

Parameters
s:ObjectInputStream

the stream

Annotations
@Serial
Exceptions
InvalidObjectException:
always
readObjectNoDataback to summary
private void readObjectNoData() throws InvalidObjectException

Throws InvalidObjectException, always.

Annotations
@Serial
Exceptions
InvalidObjectException:
always
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this UnixDomainSocketAddress.

Returns:String

this address's path which may be empty for an unnamed address

Annotations
@Override
writeReplaceback to summary
private Object writeReplace() throws ObjectStreamException

Returns a Ser containing the path name of this instance.

Returns:Object

a Ser representing the path name of this instance

Annotations
@Serial
Exceptions
ObjectStreamException:
if an error occurs
java.net back to summary

private final Class UnixDomainSocketAddress.Ser

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

A serial proxy for all UnixDomainSocketAddress instances. It captures the file path name and reconstructs using the public static factory.

Field Summary

Modifier and TypeField and Description
private final String
pathname

The path name.

pack-priv static final long

Constructor Summary

AccessConstructor and Description
pack-priv
Ser(String pathname)

Method Summary

Modifier and TypeMethod and Description
private Object

Returns:

a UnixDomainSocketAddress
readResolve
()

Creates a UnixDomainSocketAddress instance, by an invocation of the factory method passing the path name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

pathnameback to summary
private final String pathname

The path name.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID
Annotations
@Serial

Constructor Detail

Serback to summary
pack-priv Ser(String pathname)

Method Detail

readResolveback to summary
private Object readResolve()

Creates a UnixDomainSocketAddress instance, by an invocation of the factory method passing the path name.

Returns:Object

a UnixDomainSocketAddress

Annotations
@Serial