Class WildcardTypeImpl
java.lang.Object
cloud.opencode.base.reflect.type.WildcardTypeImpl
- All Implemented Interfaces:
Type, WildcardType
Wildcard Type Implementation
通配符类型实现
Implementation of WildcardType for runtime type construction.
用于运行时类型构造的WildcardType实现。
Features | 主要功能:
- WildcardType runtime construction - WildcardType运行时构造
- Upper and lower bounds support - 上界和下界支持
- Proper equals/hashCode/toString - 正确的equals/hashCode/toString
Usage Examples | 使用示例:
// ? extends Number
WildcardType upper = new WildcardTypeImpl(new Type[]{Number.class}, new Type[0]);
// ? super Integer
WildcardType lower = new WildcardTypeImpl(new Type[]{Object.class}, new Type[]{Integer.class});
Security | 安全性:
- Thread-safe: Yes (immutable) - 线程安全: 是(不可变)
- Null-safe: No (bounds arrays must be non-null) - 空值安全: 否(边界数组须非空)
- Since:
- JDK 25, opencode-base-reflect V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionWildcardTypeImpl(Type[] upperBounds, Type[] lowerBounds) Creates a wildcard type 创建通配符类型 -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic WildcardTypeImplCreates a wildcard with upper bound (?Type[]Type[]inthashCode()static WildcardTypeImplCreates a wildcard with lower bound (?toString()static WildcardTypeImplCreates an unbounded wildcard (?)Methods inherited from interface Type
getTypeName
-
Constructor Details
-
WildcardTypeImpl
-
-
Method Details
-
extendsOf
Creates a wildcard with upper bound (? extends T) 创建带上界的通配符(? extends T)- Parameters:
upperBound- the upper bound | 上界- Returns:
- wildcard type | 通配符类型
-
superOf
Creates a wildcard with lower bound (? super T) 创建带下界的通配符(? super T)- Parameters:
lowerBound- the lower bound | 下界- Returns:
- wildcard type | 通配符类型
-
unbounded
Creates an unbounded wildcard (?) 创建无界通配符(?)- Returns:
- wildcard type | 通配符类型
-
getUpperBounds
- Specified by:
getUpperBoundsin interfaceWildcardType
-
getLowerBounds
- Specified by:
getLowerBoundsin interfaceWildcardType
-
equals
-
hashCode
-
toString
-