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

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

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

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())));
}

相关文章