Java Reference
In-Depth Information
src/main/java/com/restfully/shop/domain/Customers.java
import
import
javax.ws.rs.core.Link
javax.ws.rs.core.Link
;
...
@XmlRootElement
(
name
=
"customers"
)
public
public class
class
Customers
Customers
{
protected
protected
Collection
<
Customer
>
customers
;
protected
protected
List
<
Link
>
links
;
@XmlElementRef
public
public
Collection
<
Customer
>
getCustomers
()
{
return
return
customers
;
}
public
public
void
void
setCustomers
(
Collection
<
Customer
>
customers
)
{
this
this
.
customers
=
customers
;
}
@XmlElement
(
name
=
"link"
)
@XmlJavaTypeAdapter
(
Link
.
JaxbAdapter
.
class
)
public
public
List
<
Link
>
getLinks
()
{
return
return
links
;
}
public
public
void
void
setLinks
(
List
<
Link
>
links
)
{
this
this
.
links
=
links
;
}
@XmlTransient
public
public
URI
getNext
()
{
iif
(
links
==
null
null
)
return
return null
null
;
for
for
(
Link link
:
links
)
{
iif
(
"next"
.
equals
(
link
.
getRel
()))
return
return
link
.
getUri
();
}
return
return null
null
;
}
@XmlTransient