package org.yatopiamc.yatoclip.gradle; import java.io.Serializable; import java.util.Collections; import java.util.Objects; import java.util.Set; public class PatchesMetadata { public final Set patches; public final Set relocations; public final Set copyExcludes; public PatchesMetadata(Set patches, Set relocations, Set copyExcludes) { Objects.requireNonNull(copyExcludes); this.copyExcludes = Collections.unmodifiableSet(copyExcludes); Objects.requireNonNull(relocations); this.relocations = Collections.unmodifiableSet(relocations); Objects.requireNonNull(patches); this.patches = Collections.unmodifiableSet(patches); } public static class PatchMetadata { public final String name; public final String originalHash; public final String targetHash; public final String patchHash; public PatchMetadata(String name, String originalHash, String targetHash, String patchHash) { this.name = name; this.originalHash = originalHash; this.targetHash = targetHash; this.patchHash = patchHash; } } public static class Relocation implements Serializable { public final String from; public final String to; public final boolean includeSubPackages; public Relocation(String from, String to, boolean includeSubPackages) { Objects.requireNonNull(from); Objects.requireNonNull(to); this.from = from.replaceAll("\\.", "/"); this.to = to.replaceAll("\\.", "/"); this.includeSubPackages = includeSubPackages; } } }