org.elasticsearch.common.inject.Key.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(162)

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

Key.<init>介绍

[英]Constructs a new key. Derives the type from this class's type parameter.

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.

Example usage for a binding of type Foo:

new Key() {}}.
[中]构造一个新键。从此类的类型参数派生类型。
客户端创建一个空的匿名子类。这样做会将类型参数嵌入到匿名类的类型层次结构中,这样我们就可以在运行时重建它,而不用考虑擦除。
Foo类型绑定的用法示例:
新键(){}。

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type and an annotation strategy.
 */
static <T> Key<T> get(Class<T> type,
           AnnotationStrategy annotationStrategy) {
  return new Key<>(type, annotationStrategy);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Returns a new key of the specified type with the same annotation as this
 * key.
 */
<T> Key<T> ofType(TypeLiteral<T> type) {
  return new Key<>(type, annotationStrategy);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type.
 */
public static Key<?> get(Type type) {
  return new Key<Object>(type, NullAnnotationStrategy.INSTANCE);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type.
 */
public static <T> Key<T> get(Class<T> type) {
  return new Key<>(type, NullAnnotationStrategy.INSTANCE);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type.
 */
public static <T> Key<T> get(TypeLiteral<T> typeLiteral) {
  return new Key<>(typeLiteral, NullAnnotationStrategy.INSTANCE);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Returns a new key of the specified type with the same annotation as this
 * key.
 */
<T> Key<T> ofType(Class<T> type) {
  return new Key<>(type, annotationStrategy);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Returns a new key of the specified type with the same annotation as this
 * key.
 */
Key<?> ofType(Type type) {
  return new Key<Object>(type, annotationStrategy);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type and an annotation type.
 */
public static <T> Key<T> get(Class<T> type,
               Class<? extends Annotation> annotationType) {
  return new Key<>(type, strategyFor(annotationType));
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type and an annotation type.
 */
public static <T> Key<T> get(TypeLiteral<T> typeLiteral,
               Class<? extends Annotation> annotationType) {
  return new Key<>(typeLiteral, strategyFor(annotationType));
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type and an annotation.
 */
public static <T> Key<T> get(Class<T> type, Annotation annotation) {
  return new Key<>(type, strategyFor(annotation));
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type and an annotation.
 */
public static Key<?> get(Type type, Annotation annotation) {
  return new Key<Object>(type, strategyFor(annotation));
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type and an annotation.
 */
public static <T> Key<T> get(TypeLiteral<T> typeLiteral,
               Annotation annotation) {
  return new Key<>(typeLiteral, strategyFor(annotation));
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type and an annotation type.
 */
public static Key<?> get(Type type,
             Class<? extends Annotation> annotationType) {
  return new Key<Object>(type, strategyFor(annotationType));
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Returns this key without annotation attributes, i.e. with only the
 * annotation type.
 */
Key<T> withoutAttributes() {
  return new Key<>(typeLiteral, annotationStrategy.withoutAttributes());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Gets a key for an injection type and an annotation strategy.
 */
static <T> Key<T> get(Class<T> type,
           AnnotationStrategy annotationStrategy) {
  return new Key<>(type, annotationStrategy);
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type.
 */
public static Key<?> get(Type type) {
  return new Key<Object>(type, NullAnnotationStrategy.INSTANCE);
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type.
 */
public static <T> Key<T> get(TypeLiteral<T> typeLiteral) {
  return new Key<>(typeLiteral, NullAnnotationStrategy.INSTANCE);
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Gets a key for an injection type and an annotation.
 */
public static <T> Key<T> get(TypeLiteral<T> typeLiteral,
               Annotation annotation) {
  return new Key<>(typeLiteral, strategyFor(annotation));
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Returns this key without annotation attributes, i.e. with only the
 * annotation type.
 */
Key<T> withoutAttributes() {
  return new Key<>(typeLiteral, annotationStrategy.withoutAttributes());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Gets a key for an injection type and an annotation.
 */
public static <T> Key<T> get(TypeLiteral<T> typeLiteral,
               Annotation annotation) {
  return new Key<>(typeLiteral, strategyFor(annotation));
}

相关文章