Package org.sonar.python.types.v2
Record Class ObjectType
java.lang.Object
java.lang.Record
org.sonar.python.types.v2.ObjectType
- All Implemented Interfaces:
PythonType
@Beta
public record ObjectType(PythonType type, List<PythonType> attributes, List<Member> members, TypeSource typeSource)
extends Record
implements PythonType
-
Field Summary
Fields inherited from interface org.sonar.python.types.v2.PythonType
UNKNOWN -
Constructor Summary
ConstructorsConstructorDescriptionObjectType(PythonType type) ObjectType(PythonType type, List<PythonType> attributes, List<Member> members) ObjectType(PythonType type, List<PythonType> attributes, List<Member> members, TypeSource typeSource) Creates an instance of aObjectTyperecord class.ObjectType(PythonType type, TypeSource typeSource) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.booleanisCompatibleWith(PythonType another) members()Returns the value of themembersrecord component.resolveMember(String memberName) final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.Returns the value of thetypeSourcerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.sonar.python.types.v2.PythonType
instanceDisplayName, key, name
-
Constructor Details
-
ObjectType
-
ObjectType
-
ObjectType
-
ObjectType
public ObjectType(PythonType type, List<PythonType> attributes, List<Member> members, TypeSource typeSource) Creates an instance of aObjectTyperecord class.- Parameters:
type- the value for thetyperecord componentattributes- the value for theattributesrecord componentmembers- the value for themembersrecord componenttypeSource- the value for thetypeSourcerecord component
-
-
Method Details
-
displayName
- Specified by:
displayNamein interfacePythonType
-
isCompatibleWith
- Specified by:
isCompatibleWithin interfacePythonType
-
unwrappedType
- Specified by:
unwrappedTypein interfacePythonType
-
resolveMember
- Specified by:
resolveMemberin interfacePythonType
-
hasMember
- Specified by:
hasMemberin interfacePythonType
-
definitionLocation
- Specified by:
definitionLocationin interfacePythonType
-
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). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-
members
Returns the value of themembersrecord component.- Returns:
- the value of the
membersrecord component
-
typeSource
Returns the value of thetypeSourcerecord component.- Specified by:
typeSourcein interfacePythonType- Returns:
- the value of the
typeSourcerecord component
-