Package me.ehp246.aufjms.core.reflection
Record Class InvocationOutcome<T>
java.lang.Object
java.lang.Record
me.ehp246.aufjms.core.reflection.InvocationOutcome<T>
public record InvocationOutcome<T>(T returned, Throwable thrown, boolean hasReturned)
extends Record
- Since:
- 1.0
- Author:
- Lei Yang
-
Constructor Summary
ConstructorsConstructorDescriptionInvocationOutcome(T returned, Throwable thrown, boolean hasReturned) Creates an instance of aInvocationOutcomerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasReturnedrecord component.booleanstatic <T> InvocationOutcome<T>returned()Returns the value of thereturnedrecord component.static <T> InvocationOutcome<T>returned(T returned) thrown()Returns the value of thethrownrecord component.static <T> InvocationOutcome<T>final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
InvocationOutcome
Creates an instance of aInvocationOutcomerecord class.- Parameters:
returned- the value for thereturnedrecord componentthrown- the value for thethrownrecord componenthasReturned- the value for thehasReturnedrecord component
-
-
Method Details
-
returned
-
thrown
-
invoke
-
hasThrown
public boolean hasThrown() -
outcomeValue
-
optionalReturned
-
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 '=='. -
returned
Returns the value of thereturnedrecord component.- Returns:
- the value of the
returnedrecord component
-
thrown
Returns the value of thethrownrecord component.- Returns:
- the value of the
thrownrecord component
-
hasReturned
public boolean hasReturned()Returns the value of thehasReturnedrecord component.- Returns:
- the value of the
hasReturnedrecord component
-