本文整理匯總了Java中org.elasticsearch.common.inject.TypeLiteral.get方法的典型用法代碼示例。如果您正苦於以下問題:Java TypeLiteral.get方法的具體用法?Java TypeLiteral.get怎麽用?Java TypeLiteral.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.elasticsearch.common.inject.TypeLiteral
的用法示例。
在下文中一共展示了TypeLiteral.get方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ProviderMethodsModule
import org.elasticsearch.common.inject.TypeLiteral; //導入方法依賴的package包/類
private ProviderMethodsModule(Object delegate) {
this.delegate = Objects.requireNonNull(delegate, "delegate");
this.typeLiteral = TypeLiteral.get(this.delegate.getClass());
}
示例2: setOf
import org.elasticsearch.common.inject.TypeLiteral; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") // wrapping a T in a Set safely returns a Set<T>
private static <T> TypeLiteral<Set<T>> setOf(TypeLiteral<T> elementType) {
Type type = Types.setOf(elementType.getType());
return (TypeLiteral<Set<T>>) TypeLiteral.get(type);
}
示例3: mapOf
import org.elasticsearch.common.inject.TypeLiteral; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") // a map of <K, V> is safely a Map<K, V>
private static <K, V> TypeLiteral<Map<K, V>> mapOf(
TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
return (TypeLiteral<Map<K, V>>) TypeLiteral.get(
Types.mapOf(keyType.getType(), valueType.getType()));
}
示例4: mapOfProviderOf
import org.elasticsearch.common.inject.TypeLiteral; //導入方法依賴的package包/類
@SuppressWarnings("unchecked") // a provider map <K, V> is safely a Map<K, Provider<V>>
private static <K, V> TypeLiteral<Map<K, Provider<V>>> mapOfProviderOf(
TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
return (TypeLiteral<Map<K, Provider<V>>>) TypeLiteral.get(
Types.mapOf(keyType.getType(), newParameterizedType(Provider.class, valueType.getType())));
}
示例5: entryOfProviderOf
import org.elasticsearch.common.inject.TypeLiteral; //導入方法依賴的package包/類
@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())));
}
示例6: ProviderMethodsModule
import org.elasticsearch.common.inject.TypeLiteral; //導入方法依賴的package包/類
private ProviderMethodsModule(Object delegate) {
this.delegate = checkNotNull(delegate, "delegate");
this.typeLiteral = TypeLiteral.get(this.delegate.getClass());
}