Class WildcardTypeName


  • public final class WildcardTypeName
    extends TypeName
    • Field Detail

      • upperBounds

        public final java.util.List<TypeName> upperBounds
      • lowerBounds

        public final java.util.List<TypeName> lowerBounds
    • Constructor Detail

      • WildcardTypeName

        private WildcardTypeName​(java.util.List<TypeName> upperBounds,
                                 java.util.List<TypeName> lowerBounds)
      • WildcardTypeName

        private WildcardTypeName​(java.util.List<TypeName> upperBounds,
                                 java.util.List<TypeName> lowerBounds,
                                 java.util.List<AnnotationSpec> annotations)
    • Method Detail

      • subtypeOf

        public static WildcardTypeName subtypeOf​(TypeName upperBound)
        Returns a type that represents an unknown type that extends bound. For example, if bound is CharSequence.class, this returns ? extends CharSequence. If bound is Object.class, this returns ?, which is shorthand for ? extends Object.
      • subtypeOf

        public static WildcardTypeName subtypeOf​(java.lang.reflect.Type upperBound)
      • supertypeOf

        public static WildcardTypeName supertypeOf​(TypeName lowerBound)
        Returns a type that represents an unknown supertype of bound. For example, if bound is String.class, this returns ? super String.
      • supertypeOf

        public static WildcardTypeName supertypeOf​(java.lang.reflect.Type lowerBound)
      • get

        public static TypeName get​(javax.lang.model.type.WildcardType mirror)
      • get

        static TypeName get​(javax.lang.model.type.WildcardType mirror,
                            java.util.Map<javax.lang.model.element.TypeParameterElement,​TypeVariableName> typeVariables)
      • get

        public static TypeName get​(java.lang.reflect.WildcardType wildcardName)
      • get

        static TypeName get​(java.lang.reflect.WildcardType wildcardName,
                            java.util.Map<java.lang.reflect.Type,​TypeVariableName> map)