Class NetStat.BusyPort.Builder

  • Enclosing class:
    NetStat.BusyPort

    private static class NetStat.BusyPort.Builder
    extends java.lang.Object
    • Field Detail

      • processId

        private long processId
      • localEndpoint

        private java.net.InetSocketAddress localEndpoint
      • remoteEndpoint

        private java.net.InetSocketAddress remoteEndpoint
      • shortCommand

        private java.lang.String shortCommand
      • commandLine

        private java.lang.String commandLine
    • Method Detail

      • build

        NetStat.BusyPort build()
        Constructs a NetStat.BusyPort instance from the content of this Builder. This method does not reset the content of the Builder.
        Returns:
        a new BusyPort instance
      • resetTcp

        NetStat.BusyPort.Builder resetTcp()
        Resets the TCP information in this Builder. The process-related information is retained.
        Returns:
        this Builder
      • processId

        NetStat.BusyPort.Builder processId​(java.lang.String processId)
        Sets the process id for the connection.
        Parameters:
        processId - the process id extracted from command output
        Returns:
        this Builder
      • shortCommand

        NetStat.BusyPort.Builder shortCommand​(java.lang.String shortCommand)
        Sets the short command string for the connection.
        Parameters:
        shortCommand - the short command string extracted from command output
        Returns:
        this Builder
      • commandLine

        NetStat.BusyPort.Builder commandLine​(java.lang.String commandLine)
        Sets the full/long command string for the connection.
        Parameters:
        commandLine - the full command string extracted from command output
        Returns:
        this Builder
      • localEndpoint

        NetStat.BusyPort.Builder localEndpoint​(NetStat.BusyPort.IPVersion ipVersion,
                                               java.lang.String address,
                                               java.lang.String port)
        Sets the local endpoint for the connection.
        Parameters:
        ipVersion - the IPVersion to use when interpreting ambiguous address values
        address - the IP address in a form suitable to InetAddress.getByName(String); an asterisk (*) may be used to designate "any address"
        port - the port number for the connection; an asterisk (*) may be used to designate an unassigned port
        Returns:
        this Builder
        See Also:
        localEndpoint(InetSocketAddress)
      • remoteEndpoint

        NetStat.BusyPort.Builder remoteEndpoint​(NetStat.BusyPort.IPVersion ipVersion,
                                                java.lang.String address,
                                                java.lang.String port)
        Sets the remote endpoint for the connection.
        Parameters:
        ipVersion - the IPVersion to use when interpreting ambiguous address values
        address - the IP address in a form suitable to InetAddress.getByName(String); an asterisk (*) may be used to designate "any address"
        port - the port number for the connection; an asterisk (*) may be used to designate an unassigned port
        Returns:
        this Builder
        See Also:
        remoteEndpoint(InetSocketAddress)
      • processEndpoint

        private java.net.InetSocketAddress processEndpoint​(NetStat.BusyPort.IPVersion ipVersion,
                                                           java.lang.String address,
                                                           java.lang.String port)