Class Validations
- java.lang.Object
-
- io.github.deweyjose.graphqlcodegen.Validations
-
public class Validations extends Object
-
-
Constructor Summary
Constructors Constructor Description Validations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidverifyPackageName(String name)Ensures the package name isn't null.static voidverifySchemaPaths(Collection<File> files)We sort the input files by their paths to ensure a consistent order for processing.
-
-
-
Method Detail
-
verifyPackageName
public static void verifyPackageName(String name)
Ensures the package name isn't null.- Parameters:
name-
-
verifySchemaPaths
public static void verifySchemaPaths(Collection<File> files)
We sort the input files by their paths to ensure a consistent order for processing. We maintain two sets: encounteredDirectories to keep track of encountered directories encounteredPaths to keep track of encountered paths. We iterate through the sorted files and perform the following checks: Directory overlap: throw an exception if duplicate directories are configured. Duplicate files: throw an exception if duplicate files are configured. Ancestry in already added directories: if files exist in configured directories or subdirectories of configured directories throw an exception- Parameters:
files-
-
-