@Override public boolean canBeAssignedTo(ResolvedReferenceTypeDeclaration other) { if (other instanceof LambdaArgumentTypePlaceholder) { return isFunctionalInterface(); } if (other.getQualifiedName().equals(getQualifiedName())) { return true; } if (this.clazz.getSuperclass() != null && new ReflectionInterfaceDeclaration(clazz.getSuperclass(), typeSolver).canBeAssignedTo(other)) { return true; } for (Class interfaze : clazz.getInterfaces()) { if (new ReflectionInterfaceDeclaration(interfaze, typeSolver).canBeAssignedTo(other)) { return true; } } if (other.getQualifiedName().equals(Object.class.getCanonicalName())) { return true; } return false; }
@Override public boolean canBeAssignedTo(ResolvedReferenceTypeDeclaration other) { if (other instanceof LambdaArgumentTypePlaceholder) { return isFunctionalInterface(); } if (other.getQualifiedName().equals(getQualifiedName())) { return true; } if (this.clazz.getSuperclass() != null && new ReflectionInterfaceDeclaration(clazz.getSuperclass(), typeSolver).canBeAssignedTo(other)) { return true; } for (Class interfaze : clazz.getInterfaces()) { if (new ReflectionInterfaceDeclaration(interfaze, typeSolver).canBeAssignedTo(other)) { return true; } } if (other.getQualifiedName().equals(Object.class.getCanonicalName())) { return true; } return false; }
@Override public boolean canBeAssignedTo(ResolvedReferenceTypeDeclaration other) { if (other instanceof LambdaArgumentTypePlaceholder) { return isFunctionalInterface(); } if (other.getQualifiedName().equals(getQualifiedName())) { return true; } if (this.clazz.getSuperclass() != null && new ReflectionInterfaceDeclaration(clazz.getSuperclass(), typeSolver).canBeAssignedTo(other)) { return true; } for (Class interfaze : clazz.getInterfaces()) { if (new ReflectionInterfaceDeclaration(interfaze, typeSolver).canBeAssignedTo(other)) { return true; } } if (other.getQualifiedName().equals(Object.class.getCanonicalName())) { return true; } return false; }
@Override public boolean isAssignableBy(ResolvedType type) { if (type instanceof NullType) { return true; } if (type instanceof LambdaArgumentTypePlaceholder) { return isFunctionalInterface(); } if (type.isArray()) { return false; } if (type.isPrimitive()) { return false; } if (type.describe().equals(getQualifiedName())) { return true; } if (type instanceof ReferenceTypeImpl) { ReferenceTypeImpl otherTypeDeclaration = (ReferenceTypeImpl) type; return otherTypeDeclaration.getTypeDeclaration().canBeAssignedTo(this); } return false; }
@Override public boolean isAssignableBy(ResolvedType type) { if (type instanceof NullType) { return true; } if (type instanceof LambdaArgumentTypePlaceholder) { return isFunctionalInterface(); } if (type.isArray()) { return false; } if (type.isPrimitive()) { return false; } if (type.describe().equals(getQualifiedName())) { return true; } if (type instanceof ReferenceTypeImpl) { ReferenceTypeImpl otherTypeDeclaration = (ReferenceTypeImpl) type; return otherTypeDeclaration.getTypeDeclaration().canBeAssignedTo(this); } return false; }
@Override public boolean isAssignableBy(ResolvedType type) { if (type instanceof NullType) { return true; } if (type instanceof LambdaArgumentTypePlaceholder) { return isFunctionalInterface(); } if (type.isArray()) { return false; } if (type.isPrimitive()) { return false; } if (type.describe().equals(getQualifiedName())) { return true; } if (type instanceof ReferenceTypeImpl) { ReferenceTypeImpl otherTypeDeclaration = (ReferenceTypeImpl) type; return otherTypeDeclaration.getTypeDeclaration().canBeAssignedTo(this); } return false; }