Skip to content

Instantly share code, notes, and snippets.

@gunnarmorling

gunnarmorling/Try.java

Last active Feb 10, 2016
Embed
What would you like to do?
public class Try {
@NotNull(message = "field1", groups = BaseComponent.class)
public String field1;
@NotNull(message = "field2", groups = Component.class)
public String field2;
@NotNull(message = "field3", groups = OtherComponent.class)
public String field3 = "";
public interface BaseComponent {
}
public interface Component extends BaseComponent {
}
public interface OtherComponent {
}
@GroupSequence({ Component.class, OtherComponent.class })
public interface GlobalCheck {
}
}
Set<ConstraintViolation<Try>> violations = validator.validate( new Try(), Try.GlobalCheck.class );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.