Record Class Invocation
java.lang.Object
java.lang.Record
com.github.thought2code.mcp.annotated.reflect.Invocation
This record represents the result of reflection invocation of Java method.
- Author:
- codeboyzhou
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThis class implements the builder pattern for creating a new instance ofInvocationResult. -
Constructor Summary
ConstructorsConstructorDescriptionInvocation(@NotNull Object result, boolean isError) Creates an instance of aInvocationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Invocation.Builderbuilder()Returns a new instance ofBuilderfor creating a newInvocationResult.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisError()Returns the value of theisErrorrecord component.@NotNull Objectresult()Returns the value of theresultrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Invocation
Creates an instance of aInvocationrecord class.- Parameters:
result- the value for theresultrecord componentisError- the value for theisErrorrecord component
-
-
Method Details
-
builder
Returns a new instance ofBuilderfor creating a newInvocationResult.- Returns:
- a new instance of
Builder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
isError
public boolean isError()Returns the value of theisErrorrecord component.- Returns:
- the value of the
isErrorrecord component
-