Predicated.java 654 B

1234567891011121314151617181920212223242526
  1. package utils;
  2. import play.mvc.With;
  3. import java.lang.annotation.ElementType;
  4. import java.lang.annotation.Retention;
  5. import java.lang.annotation.RetentionPolicy;
  6. import java.lang.annotation.Target;
  7. /**
  8. * Declares a composing action that will check for a condition before deciding on whether to proceed with the request.
  9. */
  10. @With(PredicatedAction.class)
  11. @Target({ElementType.TYPE, ElementType.METHOD})
  12. @Retention(RetentionPolicy.RUNTIME)
  13. public @interface Predicated {
  14. /**
  15. * The condition.
  16. */
  17. Class<? extends Predicate> predicate();
  18. /**
  19. * The http status code to return if the condition fails.
  20. */
  21. int failed();
  22. }