1/* 2 * Copyright 2004 The Apache Software Foundation 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 */ 16package org.mockito.cglib.core; 17 18import org.mockito.asm.Attribute; 19import org.mockito.asm.Type; 20 21abstract public class ClassInfo { 22 23 protected ClassInfo() { 24 } 25 26 abstract public Type getType(); 27 abstract public Type getSuperType(); 28 abstract public Type[] getInterfaces(); 29 abstract public int getModifiers(); 30 31 public boolean equals(Object o) { 32 if (o == null) 33 return false; 34 if (!(o instanceof ClassInfo)) 35 return false; 36 return getType().equals(((ClassInfo)o).getType()); 37 } 38 39 public int hashCode() { 40 return getType().hashCode(); 41 } 42 43 public String toString() { 44 // TODO: include modifiers, superType, interfaces 45 return getType().getClassName(); 46 } 47} 48