Record Class OpenProxy.RecordingProxy<T>
java.lang.Object
java.lang.Record
cloud.opencode.base.reflect.proxy.OpenProxy.RecordingProxy<T>
- Type Parameters:
T- the interface type | 接口类型
- Enclosing class:
OpenProxy
public static record OpenProxy.RecordingProxy<T>(T proxy, List<OpenProxy.MethodCall> calls)
extends Record
Recording proxy wrapper
记录代理包装器
- Since:
- JDK 25, opencode-base-reflect V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionRecordingProxy(T proxy, List<OpenProxy.MethodCall> calls) Creates an instance of aRecordingProxyrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncalls()Returns the value of thecallsrecord component.voidClears recorded calls 清除记录的调用final booleanIndicates whether some other object is "equal to" this one.intGets the number of method calls 获取方法调用次数getCallsFor(String methodName) Gets calls for a specific method 获取特定方法的调用final inthashCode()Returns a hash code value for this object.proxy()Returns the value of theproxyrecord component.final StringtoString()Returns a string representation of this record class.booleanChecks if a method was called 检查方法是否被调用
-
Constructor Details
-
RecordingProxy
Creates an instance of aRecordingProxyrecord class.- Parameters:
proxy- the value for theproxyrecord componentcalls- the value for thecallsrecord component
-
-
Method Details
-
getCallCount
public int getCallCount()Gets the number of method calls 获取方法调用次数- Returns:
- the count | 计数
-
wasCalled
Checks if a method was called 检查方法是否被调用- Parameters:
methodName- the method name | 方法名- Returns:
- true if called | 如果被调用返回true
-
getCallsFor
Gets calls for a specific method 获取特定方法的调用- Parameters:
methodName- the method name | 方法名- Returns:
- list of calls | 调用列表
-
clearCalls
public void clearCalls()Clears recorded calls 清除记录的调用 -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
proxy
Returns the value of theproxyrecord component.- Returns:
- the value of the
proxyrecord component
-
calls
Returns the value of thecallsrecord component.- Returns:
- the value of the
callsrecord component
-