Java Code Examples for org.eclipse.xtext.naming.QualifiedName.equals()

The following are Jave code examples for showing how to use equals() of the org.eclipse.xtext.naming.QualifiedName class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: n4js   File: ContainerTypesHelper.java   Source Code and License Vote up 6 votes
/**
 * Returns true if the given container type is a polyfill of the bottom type.
 * <p>
 * Note: we compare via FQN here, since the bottom type may not stem from the index but from the type model
 * derived from the AST. In that case, the type instance, although similar, differs from the type instance
 * from the index.
 */
private boolean isDirectPolyfill(ContainerType<?> containerType) {
	if (!containerType.isStaticPolyfill() || !(bottomType instanceof TClassifier)) {
		return false;
	}
	QualifiedName qn = N4TSQualifiedNameProvider.getStaticPolyfillFQN((TClassifier) bottomType,
			qualifiedNameProvider);
	if (containerType instanceof TClass) { // short cut
		return qn.equals(qualifiedNameProvider.getFullyQualifiedName(containerType));
	}
	if (containerType instanceof TN4Classifier) {
		return Iterables.any(((TN4Classifier) containerType).getSuperClassifierRefs(),
				ref -> qn.equals(qualifiedNameProvider.getFullyQualifiedName(ref.getDeclaredType())));

	}
	return false;
}