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 import static javax.xml.bind.annotation.XmlAccessType.FIELD;
8 import javax.xml.bind.annotation.XmlAccessorType;
9 import javax.xml.bind.annotation.XmlAttribute;
10 import javax.xml.bind.annotation.XmlElement;
11 import javax.xml.bind.annotation.XmlRootElement;
12
13
14
15
16 @XmlRootElement
17 @XmlAccessorType(FIELD)
18 public class Player
19 {
20 @XmlAttribute
21 private String expand;
22
23 @XmlAttribute
24 private int id;
25
26 @XmlElement
27 private String fullName;
28
29 @XmlElement
30 private Link link;
31
32 @Expandable
33 @XmlElement
34 private PlayerRecord record;
35
36 public Player()
37 {
38 }
39
40 public Player(int id, String fullName, UriBuilder builder)
41 {
42 this.id = id;
43 this.fullName = fullName;
44 this.link = Link.self(builder.build(this.id));
45 }
46
47 public Player(int id, UriBuilder builder)
48 {
49 this.id = id;
50 this.link = Link.self(builder.build(this.id));
51 }
52
53 public String getFullName()
54 {
55 return fullName;
56 }
57
58 public void setFullName(String fullName)
59 {
60 this.fullName = fullName;
61 }
62
63 public int getId()
64 {
65 return id;
66 }
67
68 public void setId(int id)
69 {
70 this.id = id;
71 }
72
73 public void setRecord(PlayerRecord record)
74 {
75 this.record = record;
76 }
77
78 public PlayerRecord getRecord()
79 {
80 return record;
81 }
82 }