Record Class TypeCompatibility.TypeCompatibilityReport
java.lang.Object
java.lang.Record
com.google.errorprone.bugpatterns.TypeCompatibility.TypeCompatibilityReport
- Enclosing class:
TypeCompatibility
public static record TypeCompatibility.TypeCompatibilityReport(boolean isCompatible, @Nullable com.sun.tools.javac.code.Type lhs, @Nullable com.sun.tools.javac.code.Type rhs, @Nullable String extraReason)
extends Record
The result of a
TypeCompatibility.compatibilityOfTypes(Type, Type, VisitorState) call.
If isCompatible is true, the other fields are null.
-
Constructor Summary
ConstructorsConstructorDescriptionTypeCompatibilityReport(boolean isCompatible, @Nullable com.sun.tools.javac.code.Type lhs, @Nullable com.sun.tools.javac.code.Type rhs, @Nullable String extraReason) Creates an instance of aTypeCompatibilityReportrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@Nullable StringReturns the value of theextraReasonrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisCompatiblerecord component.@Nullable com.sun.tools.javac.code.Typelhs()Returns the value of thelhsrecord component.@Nullable com.sun.tools.javac.code.Typerhs()Returns the value of therhsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TypeCompatibilityReport
public TypeCompatibilityReport(boolean isCompatible, @Nullable com.sun.tools.javac.code.Type lhs, @Nullable com.sun.tools.javac.code.Type rhs, @Nullable String extraReason) Creates an instance of aTypeCompatibilityReportrecord class.- Parameters:
isCompatible- the value for theisCompatiblerecord componentlhs- the value for thelhsrecord componentrhs- the value for therhsrecord componentextraReason- the value for theextraReasonrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
isCompatible
public boolean isCompatible()Returns the value of theisCompatiblerecord component.- Returns:
- the value of the
isCompatiblerecord component
-
lhs
public @Nullable com.sun.tools.javac.code.Type lhs()Returns the value of thelhsrecord component.- Returns:
- the value of the
lhsrecord component
-
rhs
public @Nullable com.sun.tools.javac.code.Type rhs()Returns the value of therhsrecord component.- Returns:
- the value of the
rhsrecord component
-
extraReason
Returns the value of theextraReasonrecord component.- Returns:
- the value of the
extraReasonrecord component
-