public ConstructorInfo getDeclaredConstructor(TypeInfo[] parameters) { if (methods == UNKNOWN_METHODS) setDeclaredConstructors(classInfoHelper.getConstructors(this)); return findConstructor(constructors, parameters); }
public MethodInfo getDeclaredMethod(String methodName, TypeInfo... parameters) { if (methods == UNKNOWN_METHODS) setDeclaredMethods(classInfoHelper.getMethods(this)); return findMethod(methods, methodName, parameters); }
public TypeInfo getArrayType() { Class<?> arrayClass = getArrayClass(getType()); return classInfoHelper.getTypeInfo(arrayClass); }
public boolean isCollection() { return Collection.class.isAssignableFrom(getType()); }
public Object newArrayInstance(int size) throws Throwable { if (isArray() == false) throw new ClassCastException(this + " is not an array."); return Array.newInstance(getComponentType().getType(), size); }
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ArrayInfo)) return false; if (!super.equals(o)) return false; final ArrayInfo arrayInfo = (ArrayInfo) o; if (!componentType.equals(arrayInfo.getComponentType())) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || obj instanceof ClassInfo == false) return false; final ClassInfo other = (ClassInfo) obj; String thisName = getName(); if (thisName != null ? thisName.equals(other.getName()) == false : other.getName() != null) return false; return true; }
public TypeInfo getArrayType() { Class<?> arrayClass = ClassInfoImpl.getArrayClass(getType()); return typeInfoFactory.getTypeInfo(arrayClass); }
public <T> T getAttachment(Class<T> expectedType) { if (expectedType == null) throw new IllegalArgumentException("Null expectedType"); Object result = getAttachment(expectedType.getName()); if (result == null) return null; return expectedType.cast(result); }
/** * Calculate the hash code */ protected void calculateHash() { int result = super.hashCode(); result = 29 * result + componentType.hashCode(); hash = result; } }
@Override protected ClassInfo getSuperHolder() { return getSuperclass(); }
public boolean isInstance(Object object) { return getType().isInstance(object); }
@SuppressWarnings("deprecation") public Object newArrayInstance(int size) throws Throwable { if (isArray() == false) throw new ClassCastException(this + " is not an array."); return Array.newInstance(getComponentType().getType(), size); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ArrayInfo)) return false; if (!super.equals(o)) return false; final ArrayInfo arrayInfo = (ArrayInfo) o; if (!componentType.equals(arrayInfo.getComponentType())) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || obj instanceof ClassInfo == false) return false; final ClassInfo other = (ClassInfo) obj; String name = getName(); if (name != null ? name.equals(other.getName()) == false : other.getName() != null) return false; return true; }
public TypeInfo getArrayType() { Class arrayClass = ClassInfoImpl.getArrayClass(getType()); return typeInfoFactory.getTypeInfo(arrayClass); }
public <T> T getAttachment(Class<T> expectedType) { if (expectedType == null) throw new IllegalArgumentException("Null expectedType"); Object result = getAttachment(expectedType.getName()); if (result == null) return null; return expectedType.cast(result); }
/** * Calculate the hash code */ protected void calculateHash() { int result = super.hashCode(); result = 29 * result + componentType.hashCode(); hash = result; } }
@Override protected InheritableAnnotationHolder getSuperHolder() { return (ClassInfoImpl) getSuperclass(); }
public ClassLoader getClassLoader() { return getType().getClassLoader(); }