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
ConstructorsConstructorDescriptionParameterV2(String name, TypeWrapper declaredType, boolean hasDefaultValue, boolean isKeywordOnly, boolean isPositionalOnly, boolean isKeywordVariadic, boolean isPositionalVariadic, LocationInFile location) Creates an instance of aParameterV2record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedeclaredTyperecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thehasDefaultValuerecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisKeywordOnlyrecord component.booleanReturns the value of theisKeywordVariadicrecord component.booleanReturns the value of theisPositionalOnlyrecord component.booleanReturns the value of theisPositionalVariadicrecord component.booleanlocation()Returns the value of thelocationrecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.
-
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 aParameterV2record class.- Parameters:
name- the value for thenamerecord componentdeclaredType- the value for thedeclaredTyperecord componenthasDefaultValue- the value for thehasDefaultValuerecord componentisKeywordOnly- the value for theisKeywordOnlyrecord componentisPositionalOnly- the value for theisPositionalOnlyrecord componentisKeywordVariadic- the value for theisKeywordVariadicrecord componentisPositionalVariadic- the value for theisPositionalVariadicrecord componentlocation- the value for thelocationrecord component
-
-
Method Details
-
isVariadic
@Beta public boolean isVariadic() -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
declaredType
Returns the value of thedeclaredTyperecord component.- Returns:
- the value of the
declaredTyperecord component
-
hasDefaultValue
public boolean hasDefaultValue()Returns the value of thehasDefaultValuerecord component.- Returns:
- the value of the
hasDefaultValuerecord component
-
isKeywordOnly
public boolean isKeywordOnly()Returns the value of theisKeywordOnlyrecord component.- Returns:
- the value of the
isKeywordOnlyrecord component
-
isPositionalOnly
public boolean isPositionalOnly()Returns the value of theisPositionalOnlyrecord component.- Returns:
- the value of the
isPositionalOnlyrecord component
-
isKeywordVariadic
public boolean isKeywordVariadic()Returns the value of theisKeywordVariadicrecord component.- Returns:
- the value of the
isKeywordVariadicrecord component
-
isPositionalVariadic
public boolean isPositionalVariadic()Returns the value of theisPositionalVariadicrecord component.- Returns:
- the value of the
isPositionalVariadicrecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-