/** * check whether or not this function type has implemented * the given interface * if this function is an interface, check whether or not * this interface has extended the given interface * @param interfaceType the interface type * @return true if implemented */ public boolean explicitlyImplOrExtInterface(FunctionType interfaceType) { Preconditions.checkArgument(interfaceType.isInterface()); for (ObjectType implementedInterface : getAllImplementedInterfaces()) { FunctionType ctor = implementedInterface.getConstructor(); if (ctor != null && ctor.checkEquivalenceHelper( interfaceType, EquivalenceMethod.IDENTITY)) { return true; } } for (ObjectType implementedInterface : getExtendedInterfaces()) { FunctionType ctor = implementedInterface.getConstructor(); if (ctor != null && ctor.checkEquivalenceHelper( interfaceType, EquivalenceMethod.IDENTITY)) { return true; } else if (ctor != null) { return ctor.explicitlyImplOrExtInterface(interfaceType); } } return false; }