/** * Constructs a new type literal. Derives represented class from type parameter. * * <p>Clients create an empty anonymous subclass. Doing so embeds the type parameter in the * anonymous class's type hierarchy so we can reconstitute it at runtime despite erasure. */ @SuppressWarnings("unchecked") protected TypeLiteral() { this.type = getSuperclassTypeParameter(getClass()); this.rawType = (Class<? super T>) MoreTypes.getRawType(type); this.hashCode = type.hashCode(); }
/** Gets type literal from super class's type parameter. */ static TypeLiteral<?> fromSuperclassTypeParameter(Class<?> subclass) { return new TypeLiteral<Object>(getSuperclassTypeParameter(subclass)); }
/** * Constructs a new type literal. Derives represented class from type parameter. * * <p>Clients create an empty anonymous subclass. Doing so embeds the type parameter in the * anonymous class's type hierarchy so we can reconstitute it at runtime despite erasure. */ @SuppressWarnings("unchecked") protected TypeLiteral() { this.type = getSuperclassTypeParameter(getClass()); this.rawType = (Class<? super T>) MoreTypes.getRawType(type); this.hashCode = type.hashCode(); }
/** * Gets type literal from super class's type parameter. */ static TypeLiteral<?> fromSuperclassTypeParameter(Class<?> subclass) { return new TypeLiteral<Object>(getSuperclassTypeParameter(subclass)); }
/** * Gets type literal from super class's type parameter. */ static TypeLiteral<?> fromSuperclassTypeParameter(Class<?> subclass) { return new TypeLiteral<Object>(getSuperclassTypeParameter(subclass)); }
/** * Gets type literal from super class's type parameter. */ static TypeLiteral<?> fromSuperclassTypeParameter(Class<?> subclass) { return new TypeLiteral<Object>(getSuperclassTypeParameter(subclass)); }
/** * Gets type literal from super class's type parameter. */ static TypeLiteral<?> fromSuperclassTypeParameter(Class<?> subclass) { return new TypeLiteral<Object>(getSuperclassTypeParameter(subclass)); }
/** * Constructs a new type literal. Derives represented class from type parameter. * * <p>Clients create an empty anonymous subclass. Doing so embeds the type parameter in the * anonymous class's type hierarchy so we can reconstitute it at runtime despite erasure. */ @SuppressWarnings("unchecked") protected TypeLiteral() { this.type = getSuperclassTypeParameter(getClass()); this.rawType = (Class<? super T>) MoreTypes.getRawType(type); this.hashCode = type.hashCode(); }
/** * Gets type literal from super class's type parameter. */ static TypeLiteral<?> fromSuperclassTypeParameter(Class<?> subclass) { return new SimpleTypeLiteral<Object>(getSuperclassTypeParameter(subclass)); }
/** Gets type literal from super class's type parameter. */ static TypeLiteral<?> fromSuperclassTypeParameter(Class<?> subclass) { return new TypeLiteral<Object>(getSuperclassTypeParameter(subclass)); }
/** Gets type literal from super class's type parameter. */ static TypeLiteral<?> fromSuperclassTypeParameter(Class<?> subclass) { return new TypeLiteral<Object>(getSuperclassTypeParameter(subclass)); }
/** * Constructs a new type literal. Derives represented class from type * parameter. * * <p>Clients create an empty anonymous subclass. Doing so embeds the type * parameter in the anonymous class's type hierarchy so we can reconstitute it * at runtime despite erasure. */ @SuppressWarnings("unchecked") protected TypeLiteral() { this.type = getSuperclassTypeParameter(getClass()); this.rawType = (Class<? super T>) getRawType(type); this.hashCode = hashCode(type); }
/** * Constructs a new type literal. Derives represented class from type * parameter. * * <p>Clients create an empty anonymous subclass. Doing so embeds the type * parameter in the anonymous class's type hierarchy so we can reconstitute it * at runtime despite erasure. */ @SuppressWarnings("unchecked") protected TypeLiteral() { this.type = getSuperclassTypeParameter(getClass()); this.rawType = (Class<? super T>) MoreTypes.getRawType(type); this.hashCode = type.hashCode(); }
/** * Constructs a new type literal. Derives represented class from type * parameter. * * <p>Clients create an empty anonymous subclass. Doing so embeds the type * parameter in the anonymous class's type hierarchy so we can reconstitute it * at runtime despite erasure. */ @SuppressWarnings("unchecked") protected TypeLiteral() { this.type = getSuperclassTypeParameter(getClass()); this.rawType = (Class<? super T>) MoreTypes.getRawType(type); this.hashCode = type.hashCode(); }
/** * Constructs a new type literal. Derives represented class from type * parameter. * * <p>Clients create an empty anonymous subclass. Doing so embeds the type * parameter in the anonymous class's type hierarchy so we can reconstitute it * at runtime despite erasure. */ @SuppressWarnings("unchecked") protected TypeLiteral() { this.type = getSuperclassTypeParameter(getClass()); this.rawType = (Class<? super T>) MoreTypes.getRawType(type); this.hashCode = type.hashCode(); }
/** * Constructs a new type literal. Derives represented class from type * parameter. * * <p>Clients create an empty anonymous subclass. Doing so embeds the type * parameter in the anonymous class's type hierarchy so we can reconstitute it * at runtime despite erasure. */ @SuppressWarnings("unchecked") protected TypeLiteral() { this.type = getSuperclassTypeParameter(getClass()); this.rawType = (Class<? super T>) MoreTypes.getRawType(type); this.hashCode = type.hashCode(); }