-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
links
and permission
model parsing
- Loading branch information
1 parent
2972e2c
commit 06b6afa
Showing
10 changed files
with
182 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
app/src/main/java/com/xfrocks/api/androiddemo/common/model/ApiModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,11 @@ | ||
package com.xfrocks.api.androiddemo.common.model; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
import java.io.Serializable; | ||
import java.util.Map; | ||
|
||
abstract public class ApiModel implements Serializable { | ||
|
||
@SerializedName("links") | ||
Map<String, String> mLinks; | ||
|
||
@SerializedName("permissions") | ||
Map<String, Boolean> mPermissions; | ||
|
||
abstract public Integer getId(); | ||
|
||
public String getPermalink() { | ||
return getLink("permalink"); | ||
} | ||
|
||
public boolean isComplete() { | ||
return true; | ||
} | ||
|
||
String getLink(String key) { | ||
if (mLinks == null) { | ||
return null; | ||
} | ||
|
||
return mLinks.get(key); | ||
} | ||
|
||
boolean checkPermission(String key) { | ||
if (mPermissions == null) { | ||
return false; | ||
} | ||
|
||
Boolean value = mPermissions.get(key); | ||
if (value == null) { | ||
return false; | ||
} | ||
|
||
return value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters