类 TypePath


  • public final class TypePath
    extends Object
    The path to a type argument, wildcard bound, array element type, or static inner type within an enclosing type.
    作者:
    Eric Bruneton
    • 方法详细资料

      • getLength

        public int getLength()
        Returns the length of this path, i.e. its number of steps.
        返回:
        the length of this path.
      • getStepArgument

        public int getStepArgument​(int index)
        Returns the index of the type argument that the given step is stepping into. This method should only be used for steps whose value is TYPE_ARGUMENT.
        参数:
        index - an index between 0 and getLength(), exclusive.
        返回:
        the index of the type argument that the given step is stepping into.
      • fromString

        public static TypePath fromString​(String typePath)
        Converts a type path in string form, in the format used by toString(), into a TypePath object.
        参数:
        typePath - a type path in string form, in the format used by toString(). May be null or empty.
        返回:
        the corresponding TypePath object, or null if the path is empty.