本文整理了Java中com.google.inject.TypeLiteral.equals()
方法的一些代码示例,展示了TypeLiteral.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TypeLiteral.equals()
方法的具体详情如下:
包路径:com.google.inject.TypeLiteral
类名称:TypeLiteral
方法名:equals
暂无
代码示例来源:origin: com.google.inject/guice
@Override
public boolean equals(Object o) {
return o instanceof InjectionPoint
&& member.equals(((InjectionPoint) o).member)
&& declaringType.equals(((InjectionPoint) o).declaringType);
}
代码示例来源:origin: com.google.inject/guice
@Override
public final boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Key<?>)) {
return false;
}
Key<?> other = (Key<?>) o;
return annotationStrategy.equals(other.annotationStrategy)
&& typeLiteral.equals(other.typeLiteral);
}
代码示例来源:origin: com.google.inject/guice
@Override
public boolean equals(Object obj) {
if (!(obj instanceof IndexedBinding)) {
return false;
}
IndexedBinding o = (IndexedBinding) obj;
return type == o.type
&& Objects.equal(scope, o.scope)
&& typeLiteral.equals(o.typeLiteral)
&& annotationType == o.annotationType
&& annotationName.equals(o.annotationName)
&& Objects.equal(extraEquality, o.extraEquality);
}
代码示例来源:origin: jooby-project/jooby
@Override
public Object next(final TypeLiteral<?> nexttype, final Object nextval)
throws Throwable {
if (cursor == parsers.size()) {
return NO_PARSER;
}
if (!type.equals(nexttype)) {
// reset cursor on type changes.
cursor = 0;
type = nexttype;
}
Parser next = parsers.get(cursor);
cursor += 1;
ParserBuilder current = builder;
builder = new ParserBuilder(this, nexttype, wrap(nextval, builder.value));
Object result = next.parse(nexttype, this);
if (result instanceof ParserBuilder) {
// call a parse
result = ((ParserBuilder) result).parse();
}
builder = current;
cursor -= 1;
return result;
}
代码示例来源:origin: com.google.inject/guice
Binding<?> binding = (Binding<?>) element;
if (bindingSelection.matchesValueKey(binding.getKey())
&& binding.getKey().getTypeLiteral().equals(bindingSelection.valueType)) {
代码示例来源:origin: com.google.inject/guice
private boolean keyMatches(Key<?> key) {
return key.getTypeLiteral().equals(elementType)
&& key.getAnnotation() instanceof Element
&& ((Element) key.getAnnotation()).setName().equals(getSetName())
&& ((Element) key.getAnnotation()).type() == MULTIBINDER;
}
代码示例来源:origin: com.google.inject/guice
/** Returns true if the key indicates this is a value in the map. */
private boolean matchesValueKey(Key<?> key) {
return key.getAnnotation() instanceof RealElement
&& ((RealElement) key.getAnnotation()).setName().equals(entrySetBinder.getSetName())
&& ((RealElement) key.getAnnotation()).type() == MAPBINDER
&& ((RealElement) key.getAnnotation()).keyType().equals(keyType.toString())
&& key.getTypeLiteral().equals(valueType);
}
代码示例来源:origin: com.google.inject.extensions/guice-assistedinject
@Override
public boolean equals(Object obj) {
if (!(obj instanceof FactoryProvider)) {
return false;
}
FactoryProvider<?> other = (FactoryProvider<?>) obj;
return factoryType.equals(other.factoryType)
&& implementationType.equals(other.implementationType);
}
代码示例来源:origin: com.google.code.guice/guice
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof TypeLiteral<?>)) {
return false;
}
TypeLiteral<?> other = (TypeLiteral<?>) o;
return equals(type, other.type);
}
代码示例来源:origin: org.sonatype.sisu.inject/guice-assistedinject
@Override
public boolean equals(Object obj) {
if (!(obj instanceof FactoryProvider)) {
return false;
}
FactoryProvider<?> other = (FactoryProvider<?>) obj;
return factoryType.equals(other.factoryType)
&& implementationType.equals(other.implementationType);
}
代码示例来源:origin: org.xbib/guice
@Override
public boolean equals(Object obj) {
if (!(obj instanceof FactoryProvider)) {
return false;
}
FactoryProvider<?> other = (FactoryProvider<?>) obj;
return factoryType.equals(other.factoryType)
&& implementationType.equals(other.implementationType);
}
}
代码示例来源:origin: Nextdoor/bender
@Override public final boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Key<?>)) {
return false;
}
Key<?> other = (Key<?>) o;
return annotationStrategy.equals(other.annotationStrategy)
&& typeLiteral.equals(other.typeLiteral);
}
代码示例来源:origin: org.xbib/guice
@Override
public final boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Key<?>)) {
return false;
}
Key<?> other = (Key<?>) o;
return annotationStrategy.equals(other.annotationStrategy)
&& typeLiteral.equals(other.typeLiteral);
}
代码示例来源:origin: org.sonatype.sisu/sisu-guice
@Override
public boolean equals(Object o) {
return o instanceof InjectionPoint
&& member.equals(((InjectionPoint) o).member)
&& declaringType.equals(((InjectionPoint) o).declaringType);
}
代码示例来源:origin: org.sonatype.sisu/sisu-guice
@Override
public final boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Key<?>)) {
return false;
}
Key<?> other = (Key<?>) o;
return annotationStrategy.equals(other.annotationStrategy)
&& typeLiteral.equals(other.typeLiteral);
}
代码示例来源:origin: com.jwebmp.inject/guice
@Override
public boolean equals(Object o) {
return o instanceof InjectionPoint
&& member.equals(((InjectionPoint) o).member)
&& declaringType.equals(((InjectionPoint) o).declaringType);
}
代码示例来源:origin: com.jwebmp.inject/guice
@Override
public boolean equals(Object obj) {
if (!(obj instanceof IndexedBinding)) {
return false;
}
IndexedBinding o = (IndexedBinding) obj;
return type == o.type
&& Objects.equal(scope, o.scope)
&& typeLiteral.equals(o.typeLiteral)
&& annotationType == o.annotationType
&& annotationName.equals(o.annotationName)
&& Objects.equal(extraEquality, o.extraEquality);
}
代码示例来源:origin: jclouds/legacy-jclouds-chef
private boolean keyMatches(Key<?> key) {
return key.getTypeLiteral().equals(elementType) && key.getAnnotation() instanceof Element
&& ((Element) key.getAnnotation()).setName().equals(setName);
}
代码示例来源:origin: org.sonatype.sisu/sisu-guice
private boolean keyMatches(Key<?> key) {
return key.getTypeLiteral().equals(elementType)
&& key.getAnnotation() instanceof Element
&& ((Element) key.getAnnotation()).setName().equals(getSetName())
&& ((Element) key.getAnnotation()).type() == MULTIBINDER;
}
代码示例来源:origin: org.sonatype.sisu/sisu-guice
/** Returns true if the key indicates this is a value in the map. */
private boolean matchesValueKey(Key<?> key) {
return key.getAnnotation() instanceof RealElement
&& ((RealElement) key.getAnnotation()).setName().equals(entrySetBinder.getSetName())
&& ((RealElement) key.getAnnotation()).type() == MAPBINDER
&& ((RealElement) key.getAnnotation()).keyType().equals(keyType.toString())
&& key.getTypeLiteral().equals(valueType);
}
内容来源于网络,如有侵权,请联系作者删除!