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

Print this page




  73 
  74     /**
  75       * Retrieves the address type of this address.
  76       *
  77       * @return The non-null address type of this address.
  78       */
  79     public String getType() {
  80         return addrType;
  81     }
  82 
  83     /**
  84       * Retrieves the contents of this address.
  85       *
  86       * @return The possibly null address contents.
  87       */
  88     public abstract Object getContent();
  89 
  90     /**
  91       * Determines whether obj is equal to this RefAddr.
  92       *<p>
  93       * obj is equal to this RefAddr all of these conditions are true
  94       *<ul>
  95       *<li> non-null
  96       *<li> instance of RefAddr
  97       *<li> obj has the same address type as this RefAddr (using String.compareTo())
  98       *<li> both obj and this RefAddr's contents are null or they are equal
  99       *         (using the equals() test).
 100       *</ul>
 101       * @param obj possibly null obj to check.
 102       * @return true if obj is equal to this refaddr; false otherwise.
 103       * @see #getContent
 104       * @see #getType
 105       */
 106     public boolean equals(Object obj) {
 107         if ((obj != null) && (obj instanceof RefAddr)) {
 108             RefAddr target = (RefAddr)obj;
 109             if (addrType.compareTo(target.addrType) == 0) {
 110                 Object thisobj = this.getContent();
 111                 Object thatobj = target.getContent();
 112                 if (thisobj == thatobj)
 113                     return true;




  73 
  74     /**
  75       * Retrieves the address type of this address.
  76       *
  77       * @return The non-null address type of this address.
  78       */
  79     public String getType() {
  80         return addrType;
  81     }
  82 
  83     /**
  84       * Retrieves the contents of this address.
  85       *
  86       * @return The possibly null address contents.
  87       */
  88     public abstract Object getContent();
  89 
  90     /**
  91       * Determines whether obj is equal to this RefAddr.
  92       *<p>
  93       * obj is equal to this RefAddr if all of these conditions are true
  94       *<ul>
  95       *<li> non-null
  96       *<li> instance of RefAddr
  97       *<li> obj has the same address type as this RefAddr (using String.compareTo())
  98       *<li> both obj and this RefAddr's contents are null or they are equal
  99       *         (using the equals() test).
 100       *</ul>
 101       * @param obj possibly null obj to check.
 102       * @return true if obj is equal to this refaddr; false otherwise.
 103       * @see #getContent
 104       * @see #getType
 105       */
 106     public boolean equals(Object obj) {
 107         if ((obj != null) && (obj instanceof RefAddr)) {
 108             RefAddr target = (RefAddr)obj;
 109             if (addrType.compareTo(target.addrType) == 0) {
 110                 Object thisobj = this.getContent();
 111                 Object thatobj = target.getContent();
 112                 if (thisobj == thatobj)
 113                     return true;