1 31 32 package org.apache.commons.httpclient.auth; 33 34 42 public abstract class AuthSchemeBase implements AuthScheme { 43 44 47 private String challenge = null; 48 49 57 public AuthSchemeBase(final String challenge) 58 throws MalformedChallengeException { 59 super(); 60 if (challenge == null) { 61 throw new IllegalArgumentException ("Challenge may not be null"); 62 } 63 this.challenge = challenge; 64 } 65 66 69 public boolean equals(Object obj) { 70 if (obj instanceof AuthSchemeBase) { 71 return this.challenge.equals(((AuthSchemeBase) obj).challenge); 72 } else { 73 return super.equals(obj); 74 } 75 } 76 77 80 public int hashCode() { 81 return this.challenge.hashCode(); 82 } 83 84 87 public String toString() { 88 return this.challenge; 89 } 90 } 91 | Popular Tags |