Back to project page ReadabilitySDK.
The source code is released under:
MIT License
If you think the Android project ReadabilitySDK listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.idemidov.readability.command.params_builders; //from w w w.jav a2 s . c o m import com.idemidov.readability.data.BookmarkOrder; import com.idemidov.readability.data.Conditions; public class GetBookmarksParamsBuilder extends BasicParamsBuilder { public GetBookmarksParamsBuilder addArchive(boolean isArchived) { addBoolean("archive", isArchived); return this; } public GetBookmarksParamsBuilder addFavorite(boolean isFavorite) { addBoolean("favorite", isFavorite); return this; } public GetBookmarksParamsBuilder addDomain(String domain) { addString("domain", domain); return this; } public GetBookmarksParamsBuilder addAddedSince(String addedSince) { addString("added_since", addedSince); return this; } public GetBookmarksParamsBuilder addAddedUntil(String addedUntil) { addString("added_until", addedUntil); return this; } public GetBookmarksParamsBuilder addOpenedUntil(String openedUntil) { addString("opened_until", openedUntil); return this; } public GetBookmarksParamsBuilder addOpenedSince(String openedSince) { addString("opened_since", openedSince); return this; } public GetBookmarksParamsBuilder addArchivedSince(String archivedSince) { addString("archived_since", archivedSince); return this; } public GetBookmarksParamsBuilder addArchivedUntil(String archivedUntil) { addString("archived_until", archivedUntil); return this; } public GetBookmarksParamsBuilder addFavoriteSince(String favoriteSince) { addString("favorited_since", favoriteSince); return this; } public GetBookmarksParamsBuilder addFavoriteUntil(String favoriteUntil) { addString("favorited_until", favoriteUntil); return this; } public GetBookmarksParamsBuilder addUpdatedSince(String updatedSince) { addString("updated_since", updatedSince); return this; } public GetBookmarksParamsBuilder addUpdatedUntil(String updatedUntil) { addString("updated_until", updatedUntil); return this; } public GetBookmarksParamsBuilder addOrder(BookmarkOrder order) { addString("order", order.getValue()); return this; } public GetBookmarksParamsBuilder addPage(int page) { addInt("page", page); return this; } public GetBookmarksParamsBuilder addPerPage(int perPage) { addInt("per_page", perPage); return this; } public GetBookmarksParamsBuilder addOnlyDeleted(boolean onlyDeleted) { addBoolean("only_deleted", onlyDeleted); return this; } public GetBookmarksParamsBuilder addTags(String... tags) { StringBuilder tagsValue = new StringBuilder(); for (int i = 0; i < tags.length; i++) { tagsValue.append(tags[i]); if (i < tags.length - 1) { tagsValue.append(","); } } addString("tags", tagsValue.toString()); return this; } public GetBookmarksParamsBuilder fromConditions(Conditions conditions) { addArchive(conditions.isArchive()); addFavorite(conditions.isFavorite()); addDomain(conditions.getDomain()); addAddedSince(conditions.getAddedSince()); addAddedUntil(conditions.getArchivedUntil()); addOpenedSince(conditions.getOpenedSince()); addOpenedUntil(conditions.getOpenedUntil()); addArchivedSince(conditions.getArchivedSince()); addArchivedUntil(conditions.getArchivedUntil()); addFavoriteSince(conditions.getFavoritedSince()); addFavoriteUntil(conditions.getFavoritedUntil()); addUpdatedSince(conditions.getUpdatedSince()); addUpdatedUntil(conditions.getUpdatedUntil()); addOrder(conditions.getOrder()); addPage(conditions.getPage()); addPerPage(conditions.getPerPage()); addOnlyDeleted(conditions.isOnlyDeleted()); return this; } }