Record Class UsageV2Impl

java.lang.Object
java.lang.Record
org.sonar.python.semantic.v2.UsageV2Impl
All Implemented Interfaces:
UsageV2

@Beta public record UsageV2Impl(Tree tree, UsageV2.Kind kind) extends Record implements UsageV2
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.sonar.plugins.python.api.symbols.v2.UsageV2

    UsageV2.Kind
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a UsageV2Impl record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
     
    Returns the value of the kind record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the tree record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • UsageV2Impl

      public UsageV2Impl(Tree tree, UsageV2.Kind kind)
      Creates an instance of a UsageV2Impl record class.
      Parameters:
      tree - the value for the tree record component
      kind - the value for the kind record component
  • Method Details

    • isBindingUsage

      @Beta public boolean isBindingUsage()
      Specified by:
      isBindingUsage in interface UsageV2
    • 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.
    • tree

      public Tree tree()
      Returns the value of the tree record component.
      Specified by:
      tree in interface UsageV2
      Returns:
      the value of the tree record component
    • kind

      public UsageV2.Kind kind()
      Returns the value of the kind record component.
      Specified by:
      kind in interface UsageV2
      Returns:
      the value of the kind record component