Class EnumHandler
java.lang.Object
cloud.opencode.base.deepclone.handler.EnumHandler
- All Implemented Interfaces:
TypeHandler<Enum<?>>
Type handler for enum values
枚举值的类型处理器
Enums are inherently immutable singletons, so cloning returns the same instance.
枚举本质上是不可变的单例,因此克隆返回相同的实例。
- Since:
- JDK 25, opencode-base-deepclone V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
EnumHandler
public EnumHandler()
-
-
Method Details
-
clone
Description copied from interface:TypeHandlerClones the object 克隆对象- Specified by:
clonein interfaceTypeHandler<Enum<?>>- Parameters:
original- the original object | 原始对象cloner- the cloner for recursive cloning | 用于递归克隆的克隆器context- the clone context | 克隆上下文- Returns:
- the cloned object | 克隆的对象
-
supports
Description copied from interface:TypeHandlerChecks if this handler supports the given type 检查此处理器是否支持给定类型- Specified by:
supportsin interfaceTypeHandler<Enum<?>>- Parameters:
type- the type to check | 要检查的类型- Returns:
- true if supported | 如果支持返回true
-
priority
public int priority()Description copied from interface:TypeHandlerGets the priority of this handler 获取此处理器的优先级Lower values indicate higher priority. Default is 100.
较小的值表示较高的优先级。默认值为100。
- Specified by:
priorityin interfaceTypeHandler<Enum<?>>- Returns:
- the priority | 优先级
-