Record Class InvocationResult
java.lang.Object
java.lang.Record
com.github.codeboyzhou.mcp.declarative.reflect.InvocationResult
public record InvocationResult(@NotNull Object result, Immutable<Exception> exception)
extends Record
This record represents the result of reflection invocation of Java method.
- 作者:
- codeboyzhou
-
嵌套类概要
嵌套类修饰符和类型类说明static final classThis class implements the builder pattern for creating a new instance ofInvocationResult. -
构造器概要
构造器构造器说明InvocationResult(@NotNull Object result, Immutable<Exception> exception) 创建InvocationResult记录的实例。 -
方法概要
修饰符和类型方法说明static InvocationResult.Builderbuilder()Returns a new instance ofBuilderfor creating a newInvocationResult.final boolean指示某个其他对象是否“等于”此对象。返回exception记录组件的值。final inthashCode()返回此对象的哈希代码值。booleanisError()Returns whether the invocation resulted in an error.@NotNull Objectresult()返回result记录组件的值。final StringtoString()返回此记录的字符串表示形式。
-
构造器详细资料
-
InvocationResult
创建InvocationResult记录的实例。- 参数:
result-result记录组件的值exception-exception记录组件的值
-
-
方法详细资料
-
isError
public boolean isError()Returns whether the invocation resulted in an error.- 返回:
trueif the invocation resulted in an error,falseotherwise
-
builder
Returns a new instance ofBuilderfor creating a newInvocationResult.- 返回:
- a new instance of
Builder
-
toString
返回此记录的字符串表示形式。此表示形式包含类型的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 此记录中的所有组件都使用Objects::equals(Object,Object)进行比较。 -
result
返回result记录组件的值。- 返回:
result记录组件的值
-
exception
返回exception记录组件的值。- 返回:
exception记录组件的值
-