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

public static record StaticImports.StaticImportInfo(String importedName, String canonicalName, com.google.common.base.Optional<String> simpleName, com.google.common.collect.ImmutableSet<com.sun.tools.javac.code.Symbol> members) extends Record
Information about a static import.
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 a StaticImportInfo record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the canonicalName record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the importedName record component.
    Builds the canonical import statement for the type.
    boolean
    Returns 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>
    Returns the value of the members record component.
    com.google.common.base.Optional<String>
    Returns the value of the simpleName record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a StaticImportInfo record class.
      Parameters:
      importedName - the value for the importedName record component
      canonicalName - the value for the canonicalName record component
      simpleName - the value for the simpleName record component
      members - the value for the members record 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

      public String importStatement()
      Builds the canonical import statement for the type.
    • 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.
    • importedName

      public String importedName()
      Returns the value of the importedName record component.
      Returns:
      the value of the importedName record component
    • canonicalName

      public String canonicalName()
      Returns the value of the canonicalName record component.
      Returns:
      the value of the canonicalName record component
    • simpleName

      public com.google.common.base.Optional<String> simpleName()
      Returns the value of the simpleName record component.
      Returns:
      the value of the simpleName record component
    • members

      public com.google.common.collect.ImmutableSet<com.sun.tools.javac.code.Symbol> members()
      Returns the value of the members record component.
      Returns:
      the value of the members record component