本文整理了Java中com.google.inject.util.Types.newParameterizedTypeWithOwner()
方法的一些代码示例,展示了Types.newParameterizedTypeWithOwner()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types.newParameterizedTypeWithOwner()
方法的具体详情如下:
包路径:com.google.inject.util.Types
类名称:Types
方法名:newParameterizedTypeWithOwner
[英]Returns a new parameterized type, applying typeArguments to rawType and enclosed by ownerType.
[中]返回一个新的参数化类型,将typeArguments应用于rawType,并由ownerType括起。
代码示例来源:origin: com.google.inject/guice
/**
* Returns a new parameterized type, applying {@code typeArguments} to {@code rawType}. The
* returned type does not have an owner type.
*
* @return a {@link java.io.Serializable serializable} parameterized type.
*/
public static ParameterizedType newParameterizedType(Type rawType, Type... typeArguments) {
return newParameterizedTypeWithOwner(null, rawType, typeArguments);
}
代码示例来源:origin: com.google.inject/guice
@SuppressWarnings("unchecked") // a provider entry <K, V> is safely a Map.Entry<K, Provider<V>>
static <K, V> TypeLiteral<Map.Entry<K, Provider<V>>> entryOfJavaxProviderOf(
TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
return (TypeLiteral<Map.Entry<K, Provider<V>>>)
TypeLiteral.get(
newParameterizedTypeWithOwner(
Map.class,
Map.Entry.class,
keyType.getType(),
Types.javaxProviderOf(valueType.getType())));
}
代码示例来源:origin: com.google.inject/guice
@SuppressWarnings("unchecked") // a provider entry <K, V> is safely a Map.Entry<K, Provider<V>>
static <K, V> TypeLiteral<Map.Entry<K, Provider<V>>> entryOfProviderOf(
TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
return (TypeLiteral<Map.Entry<K, Provider<V>>>)
TypeLiteral.get(
newParameterizedTypeWithOwner(
Map.class,
Map.Entry.class,
keyType.getType(),
Types.providerOf(valueType.getType())));
}
代码示例来源:origin: com.google.inject/guice
? Types.newParameterizedTypeWithOwner(newOwnerType, original.getRawType(), args)
: original;
代码示例来源:origin: com.google/inject
/**
* Returns a new parameterized type, applying {@code typeArguments} to
* {@code rawType}. The returned type does not have an owner type.
*
* @return a {@link java.io.Serializable serializable} parameterized type.
*/
public static ParameterizedType newParameterizedType(Type rawType, Type... typeArguments) {
return newParameterizedTypeWithOwner(null, rawType, typeArguments);
}
代码示例来源:origin: org.xbib/guice
/**
* Returns a new parameterized type, applying {@code typeArguments} to
* {@code rawType}. The returned type does not have an owner type.
*
* @return a parameterized type.
*/
public static ParameterizedType newParameterizedType(Type rawType, Type... typeArguments) {
return newParameterizedTypeWithOwner(null, rawType, typeArguments);
}
代码示例来源:origin: org.sonatype.sisu/sisu-guice
/**
* Returns a new parameterized type, applying {@code typeArguments} to {@code rawType}. The
* returned type does not have an owner type.
*
* @return a {@link java.io.Serializable serializable} parameterized type.
*/
public static ParameterizedType newParameterizedType(Type rawType, Type... typeArguments) {
return newParameterizedTypeWithOwner(null, rawType, typeArguments);
}
代码示例来源:origin: com.jwebmp.inject/guice
/**
* Returns a new parameterized type, applying {@code typeArguments} to {@code rawType}. The
* returned type does not have an owner type.
*
* @return a {@link java.io.Serializable serializable} parameterized type.
*/
public static ParameterizedType newParameterizedType(Type rawType, Type... typeArguments) {
return newParameterizedTypeWithOwner(null, rawType, typeArguments);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.inject
/**
* Returns a new parameterized type, applying {@code typeArguments} to
* {@code rawType}. The returned type does not have an owner type.
*
* @return a {@link java.io.Serializable serializable} parameterized type.
*/
public static ParameterizedType newParameterizedType(Type rawType, Type... typeArguments) {
return newParameterizedTypeWithOwner(null, rawType, typeArguments);
}
代码示例来源:origin: Nextdoor/bender
/**
* Returns a new parameterized type, applying {@code typeArguments} to
* {@code rawType}. The returned type does not have an owner type.
*
* @return a {@link java.io.Serializable serializable} parameterized type.
*/
public static ParameterizedType newParameterizedType(Type rawType, Type... typeArguments) {
return newParameterizedTypeWithOwner(null, rawType, typeArguments);
}
代码示例来源:origin: apache/james-project
private static <A extends Annotation> TypeLiteral<Stager<A>> type(Class<A> stage) {
ParameterizedType parameterizedType = Types.newParameterizedTypeWithOwner(null, Stager.class, stage);
//noinspection unchecked
@SuppressWarnings("unchecked") // TODO
TypeLiteral<Stager<A>> stagerType = (TypeLiteral<Stager<A>>) TypeLiteral.get(parameterizedType);
return stagerType;
}
代码示例来源:origin: org.sonatype.sisu.inject/guice-throwingproviders
@SuppressWarnings({"unchecked"})
private Key<P> createKey() {
TypeLiteral<P> typeLiteral;
if (interfaceType.getTypeParameters().length == 1) {
ParameterizedType type =
Types.newParameterizedTypeWithOwner(
interfaceType.getEnclosingClass(), interfaceType, valueType);
typeLiteral = (TypeLiteral<P>) TypeLiteral.get(type);
} else {
typeLiteral = TypeLiteral.get(interfaceType);
}
if (annotation != null) {
return Key.get(typeLiteral, annotation);
} else if (annotationType != null) {
return Key.get(typeLiteral, annotationType);
} else {
return Key.get(typeLiteral);
}
}
}
代码示例来源:origin: org.sonatype.sisu/sisu-guice
@SuppressWarnings("unchecked") // a provider entry <K, V> is safely a Map.Entry<K, Provider<V>>
static <K, V> TypeLiteral<Map.Entry<K, Provider<V>>> entryOfProviderOf(
TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
return (TypeLiteral<Map.Entry<K, Provider<V>>>)
TypeLiteral.get(
newParameterizedTypeWithOwner(
Map.class,
Map.Entry.class,
keyType.getType(),
Types.providerOf(valueType.getType())));
}
代码示例来源:origin: com.jwebmp.inject/guice
@SuppressWarnings("unchecked") // a provider entry <K, V> is safely a Map.Entry<K, Provider<V>>
static <K, V> TypeLiteral<Map.Entry<K, Provider<V>>> entryOfProviderOf(
TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
return (TypeLiteral<Map.Entry<K, Provider<V>>>)
TypeLiteral.get(
newParameterizedTypeWithOwner(
Map.class,
Map.Entry.class,
keyType.getType(),
Types.providerOf(valueType.getType())));
}
代码示例来源:origin: org.sonatype.sisu/sisu-guice
@SuppressWarnings("unchecked") // a provider entry <K, V> is safely a Map.Entry<K, Provider<V>>
static <K, V> TypeLiteral<Map.Entry<K, Provider<V>>> entryOfJavaxProviderOf(
TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
return (TypeLiteral<Map.Entry<K, Provider<V>>>)
TypeLiteral.get(
newParameterizedTypeWithOwner(
Map.class,
Map.Entry.class,
keyType.getType(),
Types.javaxProviderOf(valueType.getType())));
}
代码示例来源:origin: com.jwebmp.inject/guice
@SuppressWarnings("unchecked") // a provider entry <K, V> is safely a Map.Entry<K, Provider<V>>
static <K, V> TypeLiteral<Map.Entry<K, Provider<V>>> entryOfJavaxProviderOf(
TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
return (TypeLiteral<Map.Entry<K, Provider<V>>>)
TypeLiteral.get(
newParameterizedTypeWithOwner(
Map.class,
Map.Entry.class,
keyType.getType(),
Types.javaxProviderOf(valueType.getType())));
}
代码示例来源:origin: org.jclouds.api/chef
@SuppressWarnings("unchecked")
// a provider entry <K, V> is safely a Map.Entry<K, Provider<V>>
private static <K, V> TypeLiteral<Map.Entry<K, Provider<V>>> entryOfProviderOf(TypeLiteral<K> keyType,
TypeLiteral<V> valueType) {
return (TypeLiteral<Entry<K, Provider<V>>>) TypeLiteral.get(newParameterizedTypeWithOwner(Map.class, Entry.class,
keyType.getType(), Types.providerOf(valueType.getType())));
}
代码示例来源:origin: org.xbib/guice
@SuppressWarnings("unchecked") // a provider entry <K, V> is safely a Map.Entry<K, Provider<V>>
static <K, V> TypeLiteral<Entry<K, Provider<V>>> entryOfProviderOf(
TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
return (TypeLiteral<Entry<K, Provider<V>>>) TypeLiteral.get(newParameterizedTypeWithOwner(
Map.class, Entry.class, keyType.getType(), Types.providerOf(valueType.getType())));
}
代码示例来源:origin: Nextdoor/bender
@SuppressWarnings("unchecked") // a provider entry <K, V> is safely a Map.Entry<K, Provider<V>>
static <K, V> TypeLiteral<Map.Entry<K, Provider<V>>> entryOfProviderOf(
TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
return (TypeLiteral<Entry<K, Provider<V>>>) TypeLiteral.get(newParameterizedTypeWithOwner(
Map.class, Entry.class, keyType.getType(), Types.providerOf(valueType.getType())));
}
代码示例来源:origin: jclouds/legacy-jclouds-chef
@SuppressWarnings("unchecked")
// a provider entry <K, V> is safely a Map.Entry<K, Provider<V>>
private static <K, V> TypeLiteral<Map.Entry<K, Provider<V>>> entryOfProviderOf(TypeLiteral<K> keyType,
TypeLiteral<V> valueType) {
return (TypeLiteral<Entry<K, Provider<V>>>) TypeLiteral.get(newParameterizedTypeWithOwner(Map.class, Entry.class,
keyType.getType(), Types.providerOf(valueType.getType())));
}
内容来源于网络,如有侵权,请联系作者删除!