All Downloads are FREE. Search and download functionalities are using the official Maven repository.

graphql.schema.diffing.Util Maven / Gradle / Ivy

There is a newer version: 230521-nf-execution
Show newest version
package graphql.schema.diffing;

import graphql.Internal;

import java.util.List;
import java.util.Set;

@Internal
public class Util {
    public static void diffNamedList(Set sourceNames,
                                     Set targetNames,
                                     List deleted,
                                     List inserted,
                                     List same) {
        for (String sourceName : sourceNames) {
            if (targetNames.contains(sourceName)) {
                same.add(sourceName);
            } else {
                deleted.add(sourceName);
            }
        }

        for (String targetName : targetNames) {
            if (!sourceNames.contains(targetName)) {
                inserted.add(targetName);
            }
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy