Record Class StaticImports.StaticImportInfo
java.lang.Object
java.lang.Record
com.google.errorprone.bugpatterns.StaticImports.StaticImportInfo
- Record Components:
importedName- The fully qualified name used to import the type (possibly non-canonical).canonicalName- The fully-qualified canonical name of the type.simpleName- The simple name of the imported member.members- The field or variable symbol for a static non-type member import.
- Enclosing class:
StaticImports
-
Constructor Summary
ConstructorsConstructorDescriptionStaticImportInfo(String importedName, String canonicalName, com.google.common.base.Optional<String> simpleName, com.google.common.collect.ImmutableSet<com.sun.tools.javac.code.Symbol> members) Creates an instance of aStaticImportInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecanonicalNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theimportedNamerecord component.Builds the canonical import statement for the type.booleanReturns whether the import is canonical, i.e. the fully qualified name used to import the type matches the scopes it was declared in.com.google.common.collect.ImmutableSet<com.sun.tools.javac.code.Symbol> members()Returns the value of themembersrecord component.com.google.common.base.Optional<String> Returns the value of thesimpleNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StaticImportInfo
public StaticImportInfo(String importedName, String canonicalName, com.google.common.base.Optional<String> simpleName, com.google.common.collect.ImmutableSet<com.sun.tools.javac.code.Symbol> members) Creates an instance of aStaticImportInforecord class.- Parameters:
importedName- the value for theimportedNamerecord componentcanonicalName- the value for thecanonicalNamerecord componentsimpleName- the value for thesimpleNamerecord componentmembers- the value for themembersrecord component
-
-
Method Details
-
isCanonical
public boolean isCanonical()Returns whether the import is canonical, i.e. the fully qualified name used to import the type matches the scopes it was declared in. -
importStatement
Builds the canonical import statement for the type. -
toString
-
hashCode
-
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). -
importedName
Returns the value of theimportedNamerecord component.- Returns:
- the value of the
importedNamerecord component
-
canonicalName
Returns the value of thecanonicalNamerecord component.- Returns:
- the value of the
canonicalNamerecord component
-
simpleName
Returns the value of thesimpleNamerecord component.- Returns:
- the value of the
simpleNamerecord component
-
members
-