
com.malinskiy.sheldon.codegen.validator.DeleteValidator 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.auto.common.MoreTypes;
import com.malinskiy.sheldon.codegen.ProcessingException;
import javax.annotation.Nonnull;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.type.TypeKind;
public class DeleteValidator {
public static void checkValidDelete(@Nonnull ExecutableElement method) throws ProcessingException {
if (!method.getReturnType().getKind().equals(TypeKind.VOID)) {
throw new ProcessingException(
method,
"Should return void"
);
}
if (method.getParameters().size() != 1 ||
!MoreTypes.isTypeOf(String.class, method.getParameters().get(0).asType())) {
throw new ProcessingException(
method,
"Should have only one String parameter"
);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy