public boolean isGenericTypeDefinition() { if (!isGenericType()) { return false; } final TypeBindings typeArguments = getTypeBindings(); return !typeArguments.isEmpty() && !typeArguments.hasBoundParameters(); }
public TypeList getTypeArguments() { if (isGenericType()) { return getTypeBindings().getBoundTypes(); } // throw Error.notGenericType(this); return TypeList.empty(); }
public TypeList getGenericTypeParameters() { if (isGenericType()) { return getTypeBindings().getGenericParameters(); } throw Error.notGenericType(this); }
public TypeList getGenericTypeParameters() { if (isGenericType()) { return getTypeBindings().getGenericParameters(); } throw Error.notGenericType(this); }
public boolean isGenericTypeDefinition() { if (!isGenericType()) { return false; } final TypeBindings typeArguments = getTypeBindings(); return !typeArguments.isEmpty() && !typeArguments.hasBoundParameters(); }
public TypeList getGenericTypeParameters() { if (isGenericType()) { return getTypeBindings().getGenericParameters(); } throw Error.notGenericType(this); }
public TypeList getTypeArguments() { if (isGenericType()) { return getTypeBindings().getBoundTypes(); } // throw Error.notGenericType(this); return TypeList.empty(); }
GenericType(final Type genericTypeDefinition, final TypeList typeArguments) { _genericTypeDefinition = VerifyArgument.notNull(genericTypeDefinition, "genericTypeDefinition"); _typeBindings = TypeBindings.create( genericTypeDefinition.getTypeBindings().getGenericParameters(), VerifyArgument.notNull(typeArguments, "typeArguments") ); }
GenericType(final Type genericTypeDefinition, final Type... typeArguments) { _genericTypeDefinition = VerifyArgument.notNull(genericTypeDefinition, "genericTypeDefinition"); _typeBindings = TypeBindings.create( genericTypeDefinition.getTypeBindings().getGenericParameters(), VerifyArgument.notNull(typeArguments, "typeArguments") ); }
RuntimeType(final Type<?> reflectedType, final Type<T> basedOn, final TypeBindings allBindings) { _reflectedType = VerifyArgument.notNull(reflectedType, "reflectedType"); _allBindings = VerifyArgument.notNull(allBindings, "allBindings"); _erasedClass = basedOn.getErasedClass(); _basedOn = VerifyArgument.notNull(basedOn, "basedOn"); _typeBindings = basedOn.getTypeBindings(); }
RuntimeType(final Type<?> reflectedType, final Type<T> basedOn, final TypeBindings allBindings) { _reflectedType = VerifyArgument.notNull(reflectedType, "reflectedType"); _allBindings = VerifyArgument.notNull(allBindings, "allBindings"); _erasedClass = basedOn.getErasedClass(); _basedOn = VerifyArgument.notNull(basedOn, "basedOn"); _typeBindings = basedOn.getTypeBindings(); }
GenericType(final Type genericTypeDefinition, final Type... typeArguments) { _genericTypeDefinition = VerifyArgument.notNull(genericTypeDefinition, "genericTypeDefinition"); _typeBindings = TypeBindings.create( genericTypeDefinition.getTypeBindings().getGenericParameters(), VerifyArgument.notNull(typeArguments, "typeArguments") ); }
GenericType(final Type genericTypeDefinition, final TypeList typeArguments) { _genericTypeDefinition = VerifyArgument.notNull(genericTypeDefinition, "genericTypeDefinition"); _typeBindings = TypeBindings.create( genericTypeDefinition.getTypeBindings().getGenericParameters(), VerifyArgument.notNull(typeArguments, "typeArguments") ); }
GenericType(final Type genericTypeDefinition, final Type... typeArguments) { _genericTypeDefinition = VerifyArgument.notNull(genericTypeDefinition, "genericTypeDefinition"); _typeBindings = TypeBindings.create( genericTypeDefinition.getTypeBindings().getGenericParameters(), VerifyArgument.notNull(typeArguments, "typeArguments") ); }
RuntimeType(final Type<?> reflectedType, final Type<T> basedOn, final TypeBindings allBindings) { _reflectedType = VerifyArgument.notNull(reflectedType, "reflectedType"); _allBindings = VerifyArgument.notNull(allBindings, "allBindings"); _erasedClass = basedOn.getErasedClass(); _basedOn = VerifyArgument.notNull(basedOn, "basedOn"); _typeBindings = basedOn.getTypeBindings(); }
GenericType(final Type genericTypeDefinition, final TypeList typeArguments) { _genericTypeDefinition = VerifyArgument.notNull(genericTypeDefinition, "genericTypeDefinition"); _typeBindings = TypeBindings.create( genericTypeDefinition.getTypeBindings().getGenericParameters(), VerifyArgument.notNull(typeArguments, "typeArguments") ); }
public void add(final Type type) { final TypeList typeArguments; if (type.isGenericType()) { typeArguments = type.getTypeBindings().getBoundTypes(); } else { typeArguments = TypeList.empty(); } put(key(type, typeArguments), type); }
@Override public Type<?> visitClassType(final Type<?> type, final TypeBindings bindings) { if (bindings.containsGenericParameter(type)) { return bindings.getBoundType(type); } final TypeBindings oldTypeBindings = type.getTypeBindings(); final TypeBindings newTypeBindings = visitTypeBindings(oldTypeBindings, bindings); if (oldTypeBindings != newTypeBindings) { return type.getGenericTypeDefinition().makeGenericType(newTypeBindings.getBoundTypes()); } return type; }
public void add(final Type type) { final TypeList typeArguments; if (type.isGenericType()) { typeArguments = type.getTypeBindings().getBoundTypes(); } else { typeArguments = TypeList.empty(); } put(key(type.getErasedClass(), typeArguments), type); }
public void add(final Type type) { final TypeList typeArguments; if (type.isGenericType()) { typeArguments = type.getTypeBindings().getBoundTypes(); } else { typeArguments = TypeList.empty(); } put(key(type.getErasedClass(), typeArguments), type); }