Record Class CheckedExceptionsUtil.ThrownCheckedException

java.lang.Object
java.lang.Record
org.checkerframework.framework.util.typeinference8.util.CheckedExceptionsUtil.ThrownCheckedException
Record Components:
javaType - the exception type
annotatedType - the exception type, with annotations
Enclosing class:
CheckedExceptionsUtil

public static record CheckedExceptionsUtil.ThrownCheckedException(TypeMirror javaType, AnnotatedTypeMirror annotatedType) extends Record
A checked exception that a functional expression can throw, viewed both as a TypeMirror and as an AnnotatedTypeMirror. For a lambda, these are the checked exceptions that the lambda body can throw; for a method reference, they are the checked exceptions in the throws clause of the compile-time declaration.

For an exception thrown by a method invocation, javaType is the exception type as declared by the invoked method, whereas annotatedType is the exception type of the invocation, in which the method's type variables have been substituted.

  • Constructor Details

    • ThrownCheckedException

      public ThrownCheckedException(TypeMirror javaType, AnnotatedTypeMirror annotatedType)
      Creates an instance of a ThrownCheckedException record class.
      Parameters:
      javaType - the value for the javaType record component
      annotatedType - the value for the annotatedType record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • javaType

      public TypeMirror javaType()
      Returns the value of the javaType record component.
      Returns:
      the value of the javaType record component
    • annotatedType

      public AnnotatedTypeMirror annotatedType()
      Returns the value of the annotatedType record component.
      Returns:
      the value of the annotatedType record component