From 1b90921ac8697acccbd39ceffefaa7f67fd933c7 Mon Sep 17 00:00:00 2001 From: David Belmez Vicente Date: Sun, 6 Oct 2019 16:17:02 +0200 Subject: [PATCH] [feature/pattern-list-composition]: Be able to compose pattern list with different operators Signed-off-by: David Belmez Vicente --- src/main/java/javax/validation/constraints/Pattern.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/javax/validation/constraints/Pattern.java b/src/main/java/javax/validation/constraints/Pattern.java index 41f89831..dc35858f 100644 --- a/src/main/java/javax/validation/constraints/Pattern.java +++ b/src/main/java/javax/validation/constraints/Pattern.java @@ -18,7 +18,6 @@ import java.lang.annotation.Repeatable; import java.lang.annotation.Retention; import java.lang.annotation.Target; - import javax.validation.Constraint; import javax.validation.Payload; import javax.validation.constraints.Pattern.List; @@ -143,6 +142,13 @@ public int getValue() { @Documented @interface List { + enum Composition {AND, OR} + Pattern[] value(); + + /** + * @return how the patterns are composed. AND composition by default + */ + Composition composition() default Composition.AND; } }