src/main/java/pityoulish/tutorial/TutorialCommandHandler.java
public static String formatInetAddress(InetAddress ina)
   {
     String ipaddr = ina.getHostAddress();
     String hostname = ina.getHostName();
     String fqhostname = ina.getCanonicalHostName();

     if (fqhostname.equals(hostname))
        fqhostname = null;
     if (hostname.equals(ipaddr))
        hostname = null;

     StringBuilder sb = new StringBuilder(80);
     sb.append("   ").append(ipaddr);
     if (hostname != null)
        sb.append("   ").append(hostname);
     if (fqhostname != null)
        sb.append("   ").append(fqhostname);

     return sb.toString();
   }
/**
   * Formats an {@link InetAddress} into a readable string.
   *
   * @param ina   an internet address object
   *
   * @return a human-readable description of the argument
   */
Formats an  InetAddress into a readable string.
@param ina   an internet address object

@return a human-readable description of the argument
Formats an InetAddress into a readable string . @param ina an internet address object @return a human - readable description of the argument
public static String formatInetAddress(InetAddress ina)
   {
     String ipaddr = ina.getHostAddress();
     String hostname = ina.getHostName();
     String fqhostname = ina.getCanonicalHostName();
     if (fqhostname.equals(hostname))
        fqhostname = null;
     if (hostname.equals(ipaddr))
        hostname = null;
     StringBuilder sb = new StringBuilder(80);
     sb.append("   ").append(ipaddr);
     if (hostname != null)
        sb.append("   ").append(hostname);
     if (fqhostname != null)
        sb.append("   ").append(fqhostname);
     return sb.toString();
   }
public static String formatInetAddress ( InetAddress ina ) { String ipaddr = ina . getHostAddress ( ) ; String hostname = ina . getHostName ( ) ; String fqhostname = ina . getCanonicalHostName ( ) ; if ( fqhostname . equals ( hostname ) ) fqhostname = null ; if ( hostname . equals ( ipaddr ) ) hostname = null ; StringBuilder sb = new StringBuilder ( 80 ) ; sb . append ( "   " ) . append ( ipaddr ) ; if ( hostname != null ) sb . append ( "   " ) . append ( hostname ) ; if ( fqhostname != null ) sb . append ( "   " ) . append ( fqhostname ) ; return sb . toString ( ) ; }
Formats an {@link InetAddress} into a readable string.
Formats an { @link InetAddress } into a readable string .