src/java.naming/share/classes/javax/naming/RefAddr.java

Print this page
rev 10552 : 8055723[core]: Replace concat String to append in StringBuilder parameters
Contributed-by: Otavio Santana <otaviojava@java.net>


 122       * Computes the hash code of this address using its address type and contents.
 123       * The hash code is the sum of the hash code of the address type and
 124       * the hash code of the address contents.
 125       *
 126       * @return The hash code of this address as an int.
 127       * @see java.lang.Object#hashCode
 128       */
 129     public int hashCode() {
 130         return (getContent() == null)
 131                 ? addrType.hashCode()
 132                 : addrType.hashCode() + getContent().hashCode();
 133     }
 134 
 135     /**
 136       * Generates the string representation of this address.
 137       * The string consists of the address's type and contents with labels.
 138       * This representation is intended for display only and not to be parsed.
 139       * @return The non-null string representation of this address.
 140       */
 141     public String toString(){
 142         StringBuilder str = new StringBuilder("Type: " + addrType + "\n");
 143 
 144         str.append("Content: " + getContent() + "\n");
 145         return (str.toString());
 146     }
 147 
 148     /**
 149      * Use serialVersionUID from JNDI 1.1.1 for interoperability
 150      */
 151     private static final long serialVersionUID = -1468165120479154358L;
 152 }


 122       * Computes the hash code of this address using its address type and contents.
 123       * The hash code is the sum of the hash code of the address type and
 124       * the hash code of the address contents.
 125       *
 126       * @return The hash code of this address as an int.
 127       * @see java.lang.Object#hashCode
 128       */
 129     public int hashCode() {
 130         return (getContent() == null)
 131                 ? addrType.hashCode()
 132                 : addrType.hashCode() + getContent().hashCode();
 133     }
 134 
 135     /**
 136       * Generates the string representation of this address.
 137       * The string consists of the address's type and contents with labels.
 138       * This representation is intended for display only and not to be parsed.
 139       * @return The non-null string representation of this address.
 140       */
 141     public String toString(){
 142         StringBuilder str = new StringBuilder();
 143         str.append("Type: ").append(addrType).append('\n');
 144         str.append("Content: ").append(getContent()).append('\n');
 145         return (str.toString());
 146     }
 147 
 148     /**
 149      * Use serialVersionUID from JNDI 1.1.1 for interoperability
 150      */
 151     private static final long serialVersionUID = -1468165120479154358L;
 152 }