1 /* 2 * Copyright 2003 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 */ 16 package org.mockito.cglib.reflect; 17 18 import java.lang.reflect.Member; 19 20 abstract public class FastMember 21 { 22 protected FastClass fc; 23 protected Member member; 24 protected int index; 25 FastMember(FastClass fc, Member member, int index)26 protected FastMember(FastClass fc, Member member, int index) { 27 this.fc = fc; 28 this.member = member; 29 this.index = index; 30 } 31 getParameterTypes()32 abstract public Class[] getParameterTypes(); getExceptionTypes()33 abstract public Class[] getExceptionTypes(); 34 getIndex()35 public int getIndex() { 36 return index; 37 } 38 getName()39 public String getName() { 40 return member.getName(); 41 } 42 getDeclaringClass()43 public Class getDeclaringClass() { 44 return fc.getJavaClass(); 45 } 46 getModifiers()47 public int getModifiers() { 48 return member.getModifiers(); 49 } 50 toString()51 public String toString() { 52 return member.toString(); 53 } 54 hashCode()55 public int hashCode() { 56 return member.hashCode(); 57 } 58 equals(Object o)59 public boolean equals(Object o) { 60 if (o == null || !(o instanceof FastMember)) { 61 return false; 62 } 63 return member.equals(((FastMember)o).member); 64 } 65 } 66