Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. //
  2. // Source code recreated from a .class file by IntelliJ IDEA
  3. // (powered by Fernflower decompiler)
  4. //
  5.  
  6. package com.tempoplugin.team.rest.v2;
  7.  
  8. import com.tempoplugin.core.datetime.range.LocalDateRange;
  9. import com.tempoplugin.team.service.TeamImpl;
  10. import java.text.SimpleDateFormat;
  11. import javax.xml.bind.annotation.XmlAttribute;
  12. import org.joda.time.LocalDate;
  13.  
  14. public class TeamMembership {
  15. @XmlAttribute
  16. int id;
  17. @XmlAttribute
  18. String dateFrom;
  19. @XmlAttribute
  20. String dateTo;
  21. @XmlAttribute
  22. String availability;
  23. @XmlAttribute
  24. int teamMemberId;
  25. @XmlAttribute
  26. TeamImpl team;
  27. @XmlAttribute
  28. TeamRole role;
  29.  
  30. public TeamMembership(int id, LocalDate dateFrom, LocalDate dateTo, String availability, int teamMemberId, TeamImpl team, TeamRole role) {
  31. this(id, LocalDateRange.withEndInclusive(dateFrom, dateTo), availability, teamMemberId, team, role);
  32. }
  33.  
  34. public TeamMembership(int id, LocalDateRange dateRange, String availability, int teamMemberId, TeamImpl team, TeamRole role) {
  35. this.id = id;
  36. this.dateFrom = this.formatANSI(dateRange.getStartInclusive());
  37. this.dateTo = this.formatANSI(dateRange.getEndInclusive());
  38. this.availability = availability;
  39. this.teamMemberId = teamMemberId;
  40. this.team = team;
  41. this.role = role;
  42. }
  43.  
  44. private String formatANSI(LocalDate date) {
  45. if (date == null) {
  46. return null;
  47. } else {
  48. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  49. return sdf.format(date.toDate());
  50. }
  51. }
  52.  
  53. public int getId() {
  54. return this.id;
  55. }
  56.  
  57. public String getDateFrom() {
  58. return this.dateFrom;
  59. }
  60.  
  61. public String getDateTo() {
  62. return this.dateTo;
  63. }
  64.  
  65. public String getAvailability() {
  66. return this.availability;
  67. }
  68.  
  69. public int getTeamMemberId() {
  70. return this.teamMemberId;
  71. }
  72.  
  73. public TeamImpl getTeam() {
  74. return this.team;
  75. }
  76.  
  77. public TeamRole getRole() {
  78. return this.role;
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement