use of me.proxer.library.entity.notifications.Notification in project ProxerLibJava by proxer.
the class NotificationAdapter method fromJson.
@FromJson
Notification fromJson(final IntermediateNotification json) {
final String base = ProxerUrls.webBase().toString();
final HttpUrl properContentLink = HttpUrl.parse(base.substring(0, base.length() - 1) + json.contentLink);
if (properContentLink == null) {
throw new JsonDataException("Invalid link: " + json.contentLink);
}
return new Notification(json.id, json.type, json.contentId, properContentLink, json.text, json.date, json.additionalDescription);
}
Aggregations