SHARE
TWEET

Untitled

a guest Jul 19th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package codes.recursive.cnms.ords.model;
  2.  
  3. import codes.recursive.cnms.ords.validator.UniqueUsername;
  4. import com.fasterxml.jackson.annotation.JsonAlias;
  5. import com.fasterxml.jackson.annotation.JsonFormat;
  6. import com.fasterxml.jackson.annotation.JsonIgnore;
  7. import com.fasterxml.jackson.annotation.JsonProperty;
  8. import io.micronaut.core.annotation.Introspected;
  9.  
  10. import javax.validation.constraints.NotNull;
  11. import javax.validation.constraints.Size;
  12. import java.util.Date;
  13. import java.util.Map;
  14.  
  15. @Introspected
  16. @UniqueUsername(message = "Username must exist and be unique")
  17. public class User {
  18.  
  19.     @JsonAlias(value = {"id"})
  20.     @JsonProperty
  21.     private String id;
  22.  
  23.     @NotNull
  24.     @Size(max = 50)
  25.     @JsonAlias(value = {"first_name", "firstName"})
  26.     @JsonProperty("first_name")
  27.     private String firstName;
  28.  
  29.     @NotNull
  30.     @Size(max = 50)
  31.     @JsonAlias(value = {"last_name", "lastName"})
  32.     @JsonProperty("last_name")
  33.     private String lastName;
  34.  
  35.     @NotNull
  36.     @Size(max = 50)
  37.     @JsonAlias(value = {"username"})
  38.     @JsonProperty
  39.     private String username;
  40.  
  41.     @JsonAlias(value = {"created_on", "createdOn"})
  42.     @JsonProperty("created_on")
  43.     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
  44.     private Date createdOn = new Date();
  45.  
  46.     /* comes back from ORDS, we'll ignore it */
  47.     @JsonIgnore
  48.     private Map links;
  49.  
  50.     public User() { }
  51.  
  52.     public String getId() {
  53.         return id;
  54.     }
  55.  
  56.     public void setId(String id) {
  57.         this.id = id;
  58.     }
  59.  
  60.     public String getFirstName() {
  61.         return firstName;
  62.     }
  63.  
  64.     public void setFirstName(String firstName) {
  65.         this.firstName = firstName;
  66.     }
  67.  
  68.     public String getLastName() {
  69.         return lastName;
  70.     }
  71.  
  72.     public void setLastName(String lastName) {
  73.         this.lastName = lastName;
  74.     }
  75.  
  76.     public String getUsername() {
  77.         return username;
  78.     }
  79.  
  80.     public void setUsername(String username) {
  81.         this.username = username;
  82.     }
  83.  
  84.     public Date getCreatedOn() {
  85.         return createdOn;
  86.     }
  87.  
  88.     public void setCreatedOn(Date createdOn) {
  89.         this.createdOn = createdOn;
  90.     }
  91.  
  92.     public Map getLinks() {
  93.         return links;
  94.     }
  95.  
  96.     public void setLinks(Map links) {
  97.         this.links = links;
  98.     }
  99.  
  100. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top