code: public List<ConfigDescriptor> buildDescriptors(Class<?> configClass, Optional<String> scopeOpt)
      {
          if (!StaticConfigHelper.isValidConfigInterface(configClass)) {
              // condition is already logged.
              throw new ConfigException("Invalid Configuration class.");
          }
  
          List<ConfigDescriptor> descriptors = Lists.newArrayList();
  
          for (Method method : configClass.getMethods()) {
              StaticConfigHelper.MethodValidationState validationState = StaticConfigHelper.isValidConfigInterfaceMethod(method);
              switch (validationState) {
                  case OK:
                      descriptors.add(internalBuildDescriptor(method, scopeOpt, getMethodDefaultValue(method)));
                  case IS_DEFAULT:
                      // Skip default interface methods
                      break;
                  default:
                      log.debug("Configuration class {} was found to be invalid: {}",
                          configClass.getName(), validationState.name());
                      throw new ConfigException("Invalid Configuration class: {}", validationState.name());
              }
          }
  
          return descriptors;
      }
docs: Build a {@link ConfigDescriptor} given a configuration interface reference.
  
  @param configClass config interface to build descriptors for
  @param scopeOpt    optional scope name to include in config descriptors.
  @return A list of {@link ConfigDescriptor} instances describing the given config interface and scope name.