Record Class ParameterV2

java.lang.Object
java.lang.Record
org.sonar.plugins.python.api.types.v2.ParameterV2

@Beta public record ParameterV2(@Nullable String name, TypeWrapper declaredType, boolean hasDefaultValue, boolean isKeywordOnly, boolean isPositionalOnly, boolean isKeywordVariadic, boolean isPositionalVariadic, @Nullable LocationInFile location) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    ParameterV2(String name, TypeWrapper declaredType, boolean hasDefaultValue, boolean isKeywordOnly, boolean isPositionalOnly, boolean isKeywordVariadic, boolean isPositionalVariadic, LocationInFile location)
    Creates an instance of a ParameterV2 record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the declaredType record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    Returns the value of the hasDefaultValue record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the isKeywordOnly record component.
    boolean
    Returns the value of the isKeywordVariadic record component.
    boolean
    Returns the value of the isPositionalOnly record component.
    boolean
    Returns the value of the isPositionalVariadic record component.
    boolean
     
    Returns the value of the location record component.
    Returns the value of the name record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • ParameterV2

      public ParameterV2(@Nullable String name, TypeWrapper declaredType, boolean hasDefaultValue, boolean isKeywordOnly, boolean isPositionalOnly, boolean isKeywordVariadic, boolean isPositionalVariadic, @Nullable LocationInFile location)
      Creates an instance of a ParameterV2 record class.
      Parameters:
      name - the value for the name record component
      declaredType - the value for the declaredType record component
      hasDefaultValue - the value for the hasDefaultValue record component
      isKeywordOnly - the value for the isKeywordOnly record component
      isPositionalOnly - the value for the isPositionalOnly record component
      isKeywordVariadic - the value for the isKeywordVariadic record component
      isPositionalVariadic - the value for the isPositionalVariadic record component
      location - the value for the location record component
  • Method Details

    • isVariadic

      @Beta public boolean isVariadic()
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • name

      @Nullable public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • declaredType

      public TypeWrapper declaredType()
      Returns the value of the declaredType record component.
      Returns:
      the value of the declaredType record component
    • hasDefaultValue

      public boolean hasDefaultValue()
      Returns the value of the hasDefaultValue record component.
      Returns:
      the value of the hasDefaultValue record component
    • isKeywordOnly

      public boolean isKeywordOnly()
      Returns the value of the isKeywordOnly record component.
      Returns:
      the value of the isKeywordOnly record component
    • isPositionalOnly

      public boolean isPositionalOnly()
      Returns the value of the isPositionalOnly record component.
      Returns:
      the value of the isPositionalOnly record component
    • isKeywordVariadic

      public boolean isKeywordVariadic()
      Returns the value of the isKeywordVariadic record component.
      Returns:
      the value of the isKeywordVariadic record component
    • isPositionalVariadic

      public boolean isPositionalVariadic()
      Returns the value of the isPositionalVariadic record component.
      Returns:
      the value of the isPositionalVariadic record component
    • location

      @Nullable public LocationInFile location()
      Returns the value of the location record component.
      Returns:
      the value of the location record component