// Path: src/main/java/com/nfl/glitr/registry/datafetcher/query/CompositeDataFetcher.java
// public class CompositeDataFetcher extends AbstractCompositeDataFetcher {
// 
//     @SuppressWarnings("unused")
//     private static final Logger logger = LoggerFactory.getLogger(CompositeDataFetcher.class);
// 
// 
//     public CompositeDataFetcher(DataFetcher[] fetchers) {
//         super(fetchers);
//     }
// 
//     public CompositeDataFetcher(List<DataFetcher> fetchers) {
//         super(fetchers);
//     }
// }
// 
// Path: src/main/java/com/nfl/glitr/registry/datafetcher/query/OverrideDataFetcher.java
// public class OverrideDataFetcher implements DataFetcher {
// 
//     private static final Logger logger = LoggerFactory.getLogger(OverrideDataFetcher.class);
// 
//     private Object override;
//     private Method overrideMethod;
// 
// 
//     /**
//      * This constructor is used for getter overrides placed in the class itself
//      *
//      * @param name  field name
//      * @param clazz schema class
//      */
//     public OverrideDataFetcher(String name, Class clazz) {
//         overrideMethod = findMethod("get" + StringUtils.capitalize(name), clazz);
//         if (overrideMethod != null) {
//             return;
//         }
//         overrideMethod = findMethod("is" + StringUtils.capitalize(name), clazz);
//     }
// 
//     /**
//      * This constructor is used for getter overrides outside of the reference class
//      *
//      * @param name     field name
//      * @param override override object
//      */
//     public OverrideDataFetcher(String name, Object override) {
//         this(name, override.getClass());
//         this.override = override;
//     }
// 
//     @Override
//     public Object get(DataFetchingEnvironment environment) {
//         if (overrideMethod == null) {
//             return null;
//         }
// 
//         Object obj = override == null ? environment.getSource() : override;
// 
//         try {
//             return overrideMethod.invoke(obj, environment);
//         } catch (InvocationTargetException e) {
// 
//             // If the override method threw a RuntimeException just send it up
//             if (e.getTargetException() instanceof RuntimeException) {
//                 logger.debug("Something went wrong - Unable to fetch result for overrideMethod={{}} of {}", overrideMethod.getName(), obj.getClass().getSimpleName(), e.getTargetException());
//                 throw (RuntimeException) e.getTargetException();
//             }
// 
//             // Otherwise, wrap it up in a Glitr Exception
//             logger.debug("Something went wrong - Unable to fetch result for overrideMethod={{}} of {}", overrideMethod.getName(), obj.getClass().getSimpleName());
//             throw new GlitrException("Overwrite method exception", e.getTargetException());
//         } catch (Exception e) {
//             logger.debug("Something went wrong - Unable to fetch result for overrideMethod={{}} of {}", overrideMethod.getName(), obj.getClass().getSimpleName());
//         }
//         return null;
//     }
// 
//     private Method findMethod(String name, Class clazz) {
//         try {
//             //noinspection unchecked
//             return clazz.getMethod(name, DataFetchingEnvironment.class);
//         } catch (NoSuchMethodException e) {
//             logger.debug("Couldn't find method for name {} and class {}", name, clazz, e.getMessage());
//         }
//         return null;
//     }
// 
//     public Method getOverrideMethod() {
//         return overrideMethod;
//     }
// 
//     public Object getOverride() {
//         return override;
//     }
// }


import com.nfl.glitr.registry.datafetcher.query.CompositeDataFetcher;
import com.nfl.glitr.registry.datafetcher.query.OverrideDataFetcher;
import graphql.schema.DataFetcher;
import java.util.List;
import java.util.stream.Collectors;
package com.nfl.glitr.registry.datafetcher.query.batched;



/**
 * Create a CompositeDataFetcher based on the supplied DataFetchers.
 *
 */
public class CompositeDataFetcherFactory {

    public static DataFetcher create(final List<DataFetcher> supplied) {

        List<DataFetcher> fetchers = supplied.stream()
                // filter out all the OverrideDataFetchers that have a null overrideMethod since type registry adds a default overrideDF
                .filter(f -> !(f instanceof OverrideDataFetcher) || ((OverrideDataFetcher)f).getOverrideMethod() != null)
// Path: src/main/java/com/nfl/glitr/registry/datafetcher/query/CompositeDataFetcher.java
// public class CompositeDataFetcher extends AbstractCompositeDataFetcher {
// 
//     @SuppressWarnings("unused")
//     private static final Logger logger = LoggerFactory.getLogger(CompositeDataFetcher.class);
// 
// 
//     public CompositeDataFetcher(DataFetcher[] fetchers) {
//         super(fetchers);
//     }
// 
//     public CompositeDataFetcher(List<DataFetcher> fetchers) {
//         super(fetchers);
//     }
// }
// 
// Path: src/main/java/com/nfl/glitr/registry/datafetcher/query/OverrideDataFetcher.java
// public class OverrideDataFetcher implements DataFetcher {
// 
//     private static final Logger logger = LoggerFactory.getLogger(OverrideDataFetcher.class);
// 
//     private Object override;
//     private Method overrideMethod;
// 
// 
//     /**
//      * This constructor is used for getter overrides placed in the class itself
//      *
//      * @param name  field name
//      * @param clazz schema class
//      */
//     public OverrideDataFetcher(String name, Class clazz) {
//         overrideMethod = findMethod("get" + StringUtils.capitalize(name), clazz);
//         if (overrideMethod != null) {
//             return;
//         }
//         overrideMethod = findMethod("is" + StringUtils.capitalize(name), clazz);
//     }
// 
//     /**
//      * This constructor is used for getter overrides outside of the reference class
//      *
//      * @param name     field name
//      * @param override override object
//      */
//     public OverrideDataFetcher(String name, Object override) {
//         this(name, override.getClass());
//         this.override = override;
//     }
// 
//     @Override
//     public Object get(DataFetchingEnvironment environment) {
//         if (overrideMethod == null) {
//             return null;
//         }
// 
//         Object obj = override == null ? environment.getSource() : override;
// 
//         try {
//             return overrideMethod.invoke(obj, environment);
//         } catch (InvocationTargetException e) {
// 
//             // If the override method threw a RuntimeException just send it up
//             if (e.getTargetException() instanceof RuntimeException) {
//                 logger.debug("Something went wrong - Unable to fetch result for overrideMethod={{}} of {}", overrideMethod.getName(), obj.getClass().getSimpleName(), e.getTargetException());
//                 throw (RuntimeException) e.getTargetException();
//             }
// 
//             // Otherwise, wrap it up in a Glitr Exception
//             logger.debug("Something went wrong - Unable to fetch result for overrideMethod={{}} of {}", overrideMethod.getName(), obj.getClass().getSimpleName());
//             throw new GlitrException("Overwrite method exception", e.getTargetException());
//         } catch (Exception e) {
//             logger.debug("Something went wrong - Unable to fetch result for overrideMethod={{}} of {}", overrideMethod.getName(), obj.getClass().getSimpleName());
//         }
//         return null;
//     }
// 
//     private Method findMethod(String name, Class clazz) {
//         try {
//             //noinspection unchecked
//             return clazz.getMethod(name, DataFetchingEnvironment.class);
//         } catch (NoSuchMethodException e) {
//             logger.debug("Couldn't find method for name {} and class {}", name, clazz, e.getMessage());
//         }
//         return null;
//     }
// 
//     public Method getOverrideMethod() {
//         return overrideMethod;
//     }
// 
//     public Object getOverride() {
//         return override;
//     }
// }


// Path: src/main/java/com/nfl/glitr/registry/datafetcher/query/batched/CompositeDataFetcherFactory.java
import com.nfl.glitr.registry.datafetcher.query.CompositeDataFetcher;
import com.nfl.glitr.registry.datafetcher.query.OverrideDataFetcher;
import graphql.schema.DataFetcher;
import java.util.List;
import java.util.stream.Collectors;

package com.nfl.glitr.registry.datafetcher.query.batched;



/**
 * Create a CompositeDataFetcher based on the supplied DataFetchers.
 *
 */
public class CompositeDataFetcherFactory {

    public static DataFetcher create(final List<DataFetcher> supplied) {

        List<DataFetcher> fetchers = supplied.stream()
                // filter out all the OverrideDataFetchers that have a null overrideMethod since type registry adds a default overrideDF
                .filter(f -> !(f instanceof OverrideDataFetcher) || ((OverrideDataFetcher)f).getOverrideMethod() != null)
                .collect(Collectors.toList());