
com.malinskiy.sheldon.codegen.validator.ConsistencyValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compiler Show documentation
Show all versions of compiler Show documentation
Reactive preferences abstraction
package com.malinskiy.sheldon.codegen.validator;
import com.google.common.collect.HashMultiset;
import com.malinskiy.sheldon.codegen.ProcessingException;
import java.util.Set;
import javax.annotation.Nonnull;
public class ConsistencyValidator {
public static void checkConsistency(@Nonnull Set defaults,
@Nonnull Set getters,
@Nonnull Set setters) throws ProcessingException {
if (!HashMultiset.create(setters).equals(HashMultiset.create(getters)) ||
!HashMultiset.create(setters).equals(HashMultiset.create(defaults))) {
throw new ProcessingException(null, "Incomplete interface definition (missing either getter, setter or " +
"default)");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy