protected boolean hasSelfArgument() { Class<?> clazz = getObjectType(); if (clazz == null) { return false; } List<SkylarkType> types = signature.getTypes(); ImmutableList<String> names = signature.getSignature().getNames(); return (!types.isEmpty() && types.get(0).canBeCastTo(clazz)) || (!names.isEmpty() && names.get(0).equals("self")); }
/** Configure a function based on its signature */ protected void configure() { // this function is called after the signature was initialized Preconditions.checkState(signature != null); enforcedArgumentTypes = signature.getTypes(); }