Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
8aac1b49
Commit
8aac1b49
authored
Jun 02, 2018
by
yashkhem1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Convertors.java
parent
3a6c3a31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Converters.java
...ain/java/in/ac/iitb/gymkhana/iitbapp/data/Converters.java
+14
-0
No files found.
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Converters.java
View file @
8aac1b49
...
@@ -72,6 +72,20 @@ public class Converters {
...
@@ -72,6 +72,20 @@ public class Converters {
return
json
;
return
json
;
}
}
@TypeConverter
public
static
List
<
Role
>
rolesfromString
(
String
value
){
Type
listType
=
new
TypeToken
<
List
<
Role
>>(){
}.
getType
();
return
new
Gson
().
fromJson
(
value
,
listType
);
}
@TypeConverter
public
static
String
stringfromRoles
(
List
<
Role
>
list
){
Gson
gson
=
new
Gson
();
String
json
=
gson
.
toJson
(
list
);
return
json
;
}
@TypeConverter
@TypeConverter
public
static
Timestamp
timestampfromString
(
String
value
)
{
public
static
Timestamp
timestampfromString
(
String
value
)
{
try
{
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment