Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a4086d50
authored
Jun 06, 2013
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added card state and cardId to rest LastEventusers
1 parent
01346b1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/ReaderEventRestPojo.java
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/ReaderEventRestPojo.java
View file @
a4086d5
...
...
@@ -6,19 +6,23 @@ import java.util.List;
import
javax.xml.bind.annotation.XmlElement
;
import
fi.codecrew.moya.enums.CardState
;
import
fi.codecrew.moya.model.ReaderEvent
;
public
class
ReaderEventRestPojo
{
private
ReaderEvent
event
;
private
EventUserRestPojo
eventUser
;
private
PrintedCardRestPojo
printedCard
;
public
ReaderEventRestPojo
()
{
}
public
ReaderEventRestPojo
(
ReaderEvent
re
)
{
this
.
event
=
re
;
if
(
re
!=
null
&&
re
.
getPrintedCard
()
!=
null
&&
re
.
getPrintedCard
().
getUser
()
!=
null
)
{
eventUser
=
new
EventUserRestPojo
(
re
.
getPrintedCard
().
getUser
());
if
(
re
!=
null
&&
re
.
getPrintedCard
()
!=
null
)
{
if
(
re
.
getPrintedCard
().
getUser
()
!=
null
)
{
eventUser
=
new
EventUserRestPojo
(
re
.
getPrintedCard
().
getUser
());
}
}
}
...
...
@@ -42,6 +46,27 @@ public class ReaderEventRestPojo {
return
event
.
getReader
().
getId
();
}
@XmlElement
(
name
=
"printedCardId"
)
public
Integer
getPrintedCardId
()
{
Integer
ret
=
null
;
if
(
event
!=
null
&&
event
.
getPrintedCard
()
!=
null
)
{
ret
=
event
.
getPrintedCard
().
getId
();
}
return
ret
;
}
@XmlElement
(
name
=
"printedCardState"
)
public
CardState
getPrintedCardState
()
{
CardState
ret
=
null
;
if
(
event
!=
null
&&
event
.
getPrintedCard
()
!=
null
)
{
ret
=
event
.
getPrintedCard
().
getCardState
();
}
return
ret
;
}
public
static
List
<
ReaderEventRestPojo
>
parse
(
List
<
ReaderEvent
>
readers
)
{
List
<
ReaderEventRestPojo
>
ret
=
new
ArrayList
<>();
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment