1/* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package libcore.net.http; 18 19/** 20 * An RFC 2617 challenge. 21 */ 22final class Challenge { 23 final String scheme; 24 final String realm; 25 26 Challenge(String scheme, String realm) { 27 this.scheme = scheme; 28 this.realm = realm; 29 } 30 31 @Override public boolean equals(Object o) { 32 return o instanceof Challenge 33 && ((Challenge) o).scheme.equals(scheme) 34 && ((Challenge) o).realm.equals(realm); 35 } 36 37 @Override public int hashCode() { 38 return scheme.hashCode() + 31 * realm.hashCode(); 39 } 40} 41