Record Class TypeMatcherImpl
java.lang.Object
java.lang.Record
org.sonar.python.types.v2.matchers.TypeMatcherImpl
- All Implemented Interfaces:
TypeMatcher
-
Constructor Summary
ConstructorsConstructorDescriptionTypeMatcherImpl(TypePredicate predicate) Creates an instance of aTypeMatcherImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.evaluateFor(Expression expr, SubscriptionContext ctx) final inthashCode()Returns a hash code value for this object.booleanisTrueFor(Expression expr, SubscriptionContext ctx) Returns the value of thepredicaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TypeMatcherImpl
Creates an instance of aTypeMatcherImplrecord class.- Parameters:
predicate- the value for thepredicaterecord component
-
-
Method Details
-
evaluateFor
- Specified by:
evaluateForin interfaceTypeMatcher
-
isTrueFor
- Specified by:
isTrueForin interfaceTypeMatcher
-
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). -
predicate
Returns the value of thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-