Record Class EnsuresCalledMethodOnExceptionContract
java.lang.Object
java.lang.Record
org.checkerframework.checker.calledmethods.EnsuresCalledMethodOnExceptionContract
- Record Components:
expression- the expression described by this postconditionmethod- the method this postcondition promises to call
public record EnsuresCalledMethodOnExceptionContract(String expression, String method)
extends Record
A postcondition contract that a method calls the given method on the given expression when that
method throws an exception.
Instances of this class are plain old immutable data with no interesting behavior.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEnsuresCalledMethodOnExceptionContract(String expression, String method) Creates an instance of aEnsuresCalledMethodOnExceptionContractrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpressionrecord component.final inthashCode()Returns a hash code value for this object.method()Returns the value of themethodrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EnsuresCalledMethodOnExceptionContract
Creates an instance of aEnsuresCalledMethodOnExceptionContractrecord class.- Parameters:
expression- the value for theexpressionrecord componentmethod- the value for themethodrecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
expression
Returns the value of theexpressionrecord component.- Returns:
- the value of the
expressionrecord component
-
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-