Skip to content

Instantly share code, notes, and snippets.

@j-tim
Created May 17, 2020 20:27
Show Gist options
  • Save j-tim/7d23b23a01a1c75fcaf05d6086c02d73 to your computer and use it in GitHub Desktop.
Save j-tim/7d23b23a01a1c75fcaf05d6086c02d73 to your computer and use it in GitHub Desktop.
Customer validation annotations
package com.example.validation;
import lombok.Data;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
@Data
public class Customer {
@NotBlank
private final String name;
@Email
private final String email;
public Customer(String name, String email) {
this.name = name;
this.email = email;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment