com.google.inject.util.Types.javaxProviderOf()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中com.google.inject.util.Types.javaxProviderOf()方法的一些代码示例,展示了Types.javaxProviderOf()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types.javaxProviderOf()方法的具体详情如下:
包路径:com.google.inject.util.Types
类名称:Types
方法名:javaxProviderOf

Types.javaxProviderOf介绍

[英]Returns a type modelling a javax.inject.Provider that provides elements of type elementType.
[中]返回建模javax的类型。注射提供elementType类型元素的提供程序。

代码示例

代码示例来源: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 map <K, Set<V>> is safely a Map<K, Set<Provider<V>>>
static <K, V>
  TypeLiteral<Map<K, Collection<javax.inject.Provider<V>>>> mapOfCollectionOfJavaxProviderOf(
    TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
 return (TypeLiteral<Map<K, Collection<javax.inject.Provider<V>>>>)
   TypeLiteral.get(
     Types.mapOf(
       keyType.getType(), Types.collectionOf(Types.javaxProviderOf(valueType.getType()))));
}

代码示例来源:origin: com.google.inject/guice

@SuppressWarnings("unchecked") // a provider map <K, Set<V>> is safely a Map<K, Set<Provider<V>>>
static <K, V> TypeLiteral<Map<K, Set<javax.inject.Provider<V>>>> mapOfSetOfJavaxProviderOf(
  TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
 return (TypeLiteral<Map<K, Set<javax.inject.Provider<V>>>>)
   TypeLiteral.get(
     Types.mapOf(
       keyType.getType(), Types.setOf(Types.javaxProviderOf(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.sonatype.sisu/sisu-guice

@SuppressWarnings("unchecked") // a provider map <K, Set<V>> is safely a Map<K, Set<Provider<V>>>
static <K, V> TypeLiteral<Map<K, Set<javax.inject.Provider<V>>>> mapOfSetOfJavaxProviderOf(
  TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
 return (TypeLiteral<Map<K, Set<javax.inject.Provider<V>>>>)
   TypeLiteral.get(
     Types.mapOf(
       keyType.getType(), Types.setOf(Types.javaxProviderOf(valueType.getType()))));
}

代码示例来源:origin: org.sonatype.sisu/sisu-guice

@SuppressWarnings("unchecked") // a provider map <K, Set<V>> is safely a Map<K, Set<Provider<V>>>
static <K, V>
  TypeLiteral<Map<K, Collection<javax.inject.Provider<V>>>> mapOfCollectionOfJavaxProviderOf(
    TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
 return (TypeLiteral<Map<K, Collection<javax.inject.Provider<V>>>>)
   TypeLiteral.get(
     Types.mapOf(
       keyType.getType(), Types.collectionOf(Types.javaxProviderOf(valueType.getType()))));
}

代码示例来源:origin: com.jwebmp.inject/guice

@SuppressWarnings("unchecked") // a provider map <K, Set<V>> is safely a Map<K, Set<Provider<V>>>
static <K, V> TypeLiteral<Map<K, Set<javax.inject.Provider<V>>>> mapOfSetOfJavaxProviderOf(
  TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
 return (TypeLiteral<Map<K, Set<javax.inject.Provider<V>>>>)
   TypeLiteral.get(
     Types.mapOf(
       keyType.getType(), Types.setOf(Types.javaxProviderOf(valueType.getType()))));
}

代码示例来源:origin: com.jwebmp.inject/guice

@SuppressWarnings("unchecked") // a provider map <K, Set<V>> is safely a Map<K, Set<Provider<V>>>
static <K, V>
  TypeLiteral<Map<K, Collection<javax.inject.Provider<V>>>> mapOfCollectionOfJavaxProviderOf(
    TypeLiteral<K> keyType, TypeLiteral<V> valueType) {
 return (TypeLiteral<Map<K, Collection<javax.inject.Provider<V>>>>)
   TypeLiteral.get(
     Types.mapOf(
       keyType.getType(), Types.collectionOf(Types.javaxProviderOf(valueType.getType()))));
}

相关文章