Example usage for java.net ServerSocket hashCode

List of usage examples for java.net ServerSocket hashCode

Introduction

In this page you can find the example usage for java.net ServerSocket hashCode.

Prototype

@HotSpotIntrinsicCandidate
public native int hashCode();

Source Link

Document

Returns a hash code value for the object.

Usage

From source file:Main.java

/**
 * Renders the details of a server socket in the returned string
 * @param socket The server socket to render
 * @return the details of the server socket as a string
 *//*from www . j a  v a2s .com*/
public static String render(ServerSocket socket) {
    if (socket == null)
        return "NULL";
    StringBuilder b = new StringBuilder("\nSocket [");
    b.append("\n\tLocalPort:").append(socket.getLocalPort());
    b.append("\n\tLocalAddress:").append(socket.getInetAddress());
    b.append("\n\tLocalSocketAddress:").append(socket.getLocalSocketAddress());
    b.append("\n\tChannel:").append(socket.getChannel());
    b.append("\n\tHashCode:").append(socket.hashCode());
    b.append("\n]");
    return b.toString();
}