Interface CloneListener
public interface CloneListener
Listener interface for clone lifecycle events
克隆生命周期事件的监听器接口
Implementations can observe and react to events during the cloning process, such as before and after an object is cloned, or when an error occurs.
实现可以观察和响应克隆过程中的事件,如对象克隆前后,或发生错误时。
- Since:
- JDK 25, opencode-base-deepclone V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterClone(Object original, Object cloned, CloneContext context) Called after an object is cloned 在对象克隆之后调用default voidbeforeClone(Object original, CloneContext context) Called before an object is cloned 在对象克隆之前调用default voidonError(Object original, Throwable error, CloneContext context) Called when a clone error occurs 当克隆错误发生时调用
-
Method Details
-
beforeClone
Called before an object is cloned 在对象克隆之前调用- Parameters:
original- the original object | 原始对象context- the clone context | 克隆上下文
-
afterClone
Called after an object is cloned 在对象克隆之后调用- Parameters:
original- the original object | 原始对象cloned- the cloned object | 克隆的对象context- the clone context | 克隆上下文
-
onError
Called when a clone error occurs 当克隆错误发生时调用- Parameters:
original- the original object | 原始对象error- the error | 错误context- the clone context | 克隆上下文
-