PageRenderTime 2786ms CodeModel.GetById 34ms RepoModel.GetById 10ms app.codeStats 0ms

/json/src/test/java/fast_json/Person.java

https://github.com/juniorsatanas/SpringSecurityVraptor
Java | 69 lines | 50 code | 19 blank | 0 comment | 0 complexity | 8f67796391e51abc00e4e2c29de1c8ea MD5 | raw file
  1. package fast_json;
  2. import com.alibaba.fastjson.annotation.JSONField;
  3. import java.util.Date;
  4. public class Person {
  5. @JSONField(name = "AGE", serialize = false, deserialize = false)
  6. private int age;
  7. @JSONField(name = "LAST NAME", ordinal = 2)
  8. private String lastName;
  9. @JSONField(name = "FIRST NAME", ordinal = 1)
  10. private String firstName;
  11. @JSONField(name = "DATE OF BIRTH", format = "dd/MM/yyyy", ordinal = 3)
  12. private Date dateOfBirth;
  13. public Person() {
  14. }
  15. public Person(int age, String lastName, String firstName, Date dateOfBirth) {
  16. super();
  17. this.age = age;
  18. this.lastName = lastName;
  19. this.firstName = firstName;
  20. this.dateOfBirth = dateOfBirth;
  21. }
  22. @Override
  23. public String toString() {
  24. return "Person [age=" + age + ", lastName=" + lastName + ", firstName=" + firstName + ", dateOfBirth=" + dateOfBirth + "]";
  25. }
  26. public int getAge() {
  27. return age;
  28. }
  29. public void setAge(int age) {
  30. this.age = age;
  31. }
  32. public String getLastName() {
  33. return lastName;
  34. }
  35. public void setLastName(String lastName) {
  36. this.lastName = lastName;
  37. }
  38. public String getFirstName() {
  39. return firstName;
  40. }
  41. public void setFirstName(String firstName) {
  42. this.firstName = firstName;
  43. }
  44. public Date getDateOfBirth() {
  45. return dateOfBirth;
  46. }
  47. public void setDateOfBirth(Date dateOfBirth) {
  48. this.dateOfBirth = dateOfBirth;
  49. }
  50. }