User.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package com.primeton.dgs.workspace.extractor.jaxb;
  2. import javax.xml.bind.annotation.XmlAccessOrder;
  3. import javax.xml.bind.annotation.XmlAccessType;
  4. import javax.xml.bind.annotation.XmlAccessorOrder;
  5. import javax.xml.bind.annotation.XmlAccessorType;
  6. import javax.xml.bind.annotation.XmlAttribute;
  7. import javax.xml.bind.annotation.XmlElement;
  8. import javax.xml.bind.annotation.XmlRootElement;
  9. import javax.xml.bind.annotation.XmlTransient;
  10. import javax.xml.bind.annotation.XmlType;
  11. import java.io.Serializable;
  12. /**
  13. * <pre>
  14. *
  15. * Created by zhaopx.
  16. * User: zhaopx
  17. * Date: 2019/9/10
  18. * Time: 14:14
  19. *
  20. * </pre>
  21. *
  22. * @author zhaopx
  23. */
  24. @XmlType(propOrder = {})
  25. @XmlRootElement(name = "user")
  26. @XmlAccessorType(XmlAccessType.PROPERTY)
  27. @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)
  28. public class User implements Serializable {
  29. private String userName;
  30. private int age;
  31. private String role;
  32. private String bibi;
  33. public User() {
  34. }
  35. public User(String userName, int age, String role, String bibi) {
  36. this.userName = userName;
  37. this.age = age;
  38. this.role = role;
  39. this.bibi = bibi;
  40. }
  41. public String getUserName() {
  42. return userName;
  43. }
  44. public void setUserName(String userName) {
  45. this.userName = userName;
  46. }
  47. @XmlAttribute
  48. public int getAge() {
  49. return age;
  50. }
  51. public void setAge(int age) {
  52. this.age = age;
  53. }
  54. @XmlElement
  55. public String getRole() {
  56. return role;
  57. }
  58. public void setRole(String role) {
  59. this.role = role;
  60. }
  61. @XmlTransient
  62. public String getBibi() {
  63. return bibi;
  64. }
  65. public void setBibi(String bibi) {
  66. this.bibi = bibi;
  67. }
  68. @Override
  69. public String toString() {
  70. return "User{" +
  71. "userName='" + userName + '\'' +
  72. ", age=" + age +
  73. ", role='" + role + '\'' +
  74. ", bibi='" + bibi + '\'' +
  75. '}';
  76. }
  77. }