Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Source code recreated from a .class file by IntelliJ IDEA
- // (powered by Fernflower decompiler)
- //
- package com.tempoplugin.team.rest.v2;
- import com.tempoplugin.core.datetime.range.LocalDateRange;
- import com.tempoplugin.team.service.TeamImpl;
- import java.text.SimpleDateFormat;
- import javax.xml.bind.annotation.XmlAttribute;
- import org.joda.time.LocalDate;
- public class TeamMembership {
- @XmlAttribute
- int id;
- @XmlAttribute
- String dateFrom;
- @XmlAttribute
- String dateTo;
- @XmlAttribute
- String availability;
- @XmlAttribute
- int teamMemberId;
- @XmlAttribute
- TeamImpl team;
- @XmlAttribute
- TeamRole role;
- public TeamMembership(int id, LocalDate dateFrom, LocalDate dateTo, String availability, int teamMemberId, TeamImpl team, TeamRole role) {
- this(id, LocalDateRange.withEndInclusive(dateFrom, dateTo), availability, teamMemberId, team, role);
- }
- public TeamMembership(int id, LocalDateRange dateRange, String availability, int teamMemberId, TeamImpl team, TeamRole role) {
- this.id = id;
- this.dateFrom = this.formatANSI(dateRange.getStartInclusive());
- this.dateTo = this.formatANSI(dateRange.getEndInclusive());
- this.availability = availability;
- this.teamMemberId = teamMemberId;
- this.team = team;
- this.role = role;
- }
- private String formatANSI(LocalDate date) {
- if (date == null) {
- return null;
- } else {
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
- return sdf.format(date.toDate());
- }
- }
- public int getId() {
- return this.id;
- }
- public String getDateFrom() {
- return this.dateFrom;
- }
- public String getDateTo() {
- return this.dateTo;
- }
- public String getAvailability() {
- return this.availability;
- }
- public int getTeamMemberId() {
- return this.teamMemberId;
- }
- public TeamImpl getTeam() {
- return this.team;
- }
- public TeamRole getRole() {
- return this.role;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement