1 package com.atlassian.plugins.rest.sample.expansion.entity;
2
3 import com.atlassian.plugins.rest.common.Link;
4 import com.atlassian.plugins.rest.common.expand.Expandable;
5
6 import javax.ws.rs.core.UriBuilder;
7
8 import static javax.xml.bind.annotation.XmlAccessType.FIELD;
9
10 import javax.xml.bind.annotation.XmlAccessorType;
11 import javax.xml.bind.annotation.XmlAttribute;
12 import javax.xml.bind.annotation.XmlElement;
13 import javax.xml.bind.annotation.XmlRootElement;
14
15
16
17
18 @XmlRootElement
19 @XmlAccessorType(FIELD)
20 public class Player {
21 @XmlAttribute
22 private String expand;
23
24 @XmlAttribute
25 private int id;
26
27 @XmlElement
28 private String fullName;
29
30 @XmlElement
31 private Link link;
32
33 @Expandable
34 @XmlElement
35 private PlayerRecord record;
36
37 public Player() {
38 }
39
40 public Player(int id, String fullName, UriBuilder builder) {
41 this.id = id;
42 this.fullName = fullName;
43 this.link = Link.self(builder.build(this.id));
44 }
45
46 public Player(int id, UriBuilder builder) {
47 this.id = id;
48 this.link = Link.self(builder.build(this.id));
49 }
50
51 public String getFullName() {
52 return fullName;
53 }
54
55 public void setFullName(String fullName) {
56 this.fullName = fullName;
57 }
58
59 public int getId() {
60 return id;
61 }
62
63 public void setId(int id) {
64 this.id = id;
65 }
66
67 public void setRecord(PlayerRecord record) {
68 this.record = record;
69 }
70
71 public PlayerRecord getRecord() {
72 return record;
73 }
74 }