Android Open Source - meets-android Meets Collection






From Project

Back to project page meets-android.

License

The source code is released under:

MIT License

If you think the Android project meets-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.theagilemonkeys.meets.models.base;
/* w  w  w.  ja  v  a  2s. c o m*/
import com.theagilemonkeys.meets.ApiMethodModelHelperInterface;

import java.io.Serializable;
import java.util.Map;

/**
 * Android Meets SDK
 * Original work Copyright (c) 2014 [TheAgileMonkeys]
 *
 * @author ??lvaro Lpez Espinosa
 */
public interface MeetsCollection<MODEL> extends ApiMethodModelHelperInterface<MeetsCollection<MODEL>>, Serializable {
    /**
     * Fetch a new bunch of models from the server, using page, pageSize and any extra filters
     * set with setFilters. It can trigger any of these events (and in that specific order):
     * - listener.onReset if the collection has been configured to reset on fetch. At this point,
     * the collection is empty.
     * - listener.onPush for each model added which was not already present in the collection.
     * - listener.onFetch when all models has been added, so the fetch operation has finished.
     * @return This object for chaining purposes
     */
    MeetsCollection<MODEL> fetch();

    /**
     * Add a model to the collection. If the model already exist (its id is the same as any other in
     * the collection) it WON'T be added. Triggers listener.onPush when the model is successfully added.
     * @param model The model to add.
     * @return this object for chaining purposes
     */
    MeetsCollection<MODEL> insert(MODEL model);

    /**
     * Extract the model with the passed id. Triggers listener.onExtract when the model is successfully extracted.
     * @param modelId Id of the model
     * @return The extracted model
     */
    MODEL extract(int modelId);

    /**
     * Extract all the models. Triggers listener.onExtract for each extracted model and then listener.onReset
     * @return this object for chaining purposes
     */
    MeetsCollection<MODEL> reset();

    /**
     * Returns the number of model in this collection
     * @return
     */
    int getSize();

    MODEL get(int index);
    /**
     * Increment the page. Useful before fetch a new page of models from the server.
     * @return this object for chaining purposes
     */
    MeetsCollection<MODEL> nextPage();

    /**
     * Set a specific page. Useful before fetch a new page of models from the server.
     * @param page The number of page
     * @return this object for chaining purposes
     */
    MeetsCollection<MODEL> setPage(int page);

    /**
     * Sets the number of models fetched from the server for each page.
     * @param pageSize The number of models per page
     * @return this object for chaining purposes
     */
    MeetsCollection<MODEL> setPageSize(int pageSize);

    /**
     * If a true is passed, then each call to fetch will replace the entire collection with
     * the models fetched.
     * @param reset A boolean value.
     * @return this object for chaining purposes
     */
    MeetsCollection<MODEL> setResetOnFetch(boolean reset);

    /**
     * Sets any filters that will be send to server in each call to fetch.
     * @param filters A Map with filters
     * @return this object for chaining purposes
     */
    MeetsCollection<MODEL> setFilters(Map<String, Object> filters);

    /**
     * Get the current page
     * @return int
     */
    int getPage();

    /**
     * Get the current page size
     * @return int
     */
    int getPageSize();

    /**
     * TODO
     * @param weakAttributes
     * @return
     */
    MeetsCollection<MODEL> include(String... weakAttributes);
}




Java Source Code List

com.theagilemonkeys.meets.ApiMethodModelHelperInterface.java
com.theagilemonkeys.meets.ApiMethodModelHelper.java
com.theagilemonkeys.meets.ApiMethod.java
com.theagilemonkeys.meets.MeetsSpiceService.java
com.theagilemonkeys.meets.Meets.java
com.theagilemonkeys.meets.magento.RestApiMethod.java
com.theagilemonkeys.meets.magento.SoapApiMethod.java
com.theagilemonkeys.meets.magento.methods.CatalogCategoryInfo.java
com.theagilemonkeys.meets.magento.methods.CatalogCategoryLevel.java
com.theagilemonkeys.meets.magento.methods.CatalogCategoryTree.java
com.theagilemonkeys.meets.magento.methods.CatalogInventoryStockItemList.java
com.theagilemonkeys.meets.magento.methods.CatalogProductAttributeOptions.java
com.theagilemonkeys.meets.magento.methods.CatalogProductInfo.java
com.theagilemonkeys.meets.magento.methods.CatalogProductList.java
com.theagilemonkeys.meets.magento.methods.CustomerAddressCreate.java
com.theagilemonkeys.meets.magento.methods.CustomerAddressDelete.java
com.theagilemonkeys.meets.magento.methods.CustomerAddressInfo.java
com.theagilemonkeys.meets.magento.methods.CustomerAddressList.java
com.theagilemonkeys.meets.magento.methods.CustomerAddressUpdate.java
com.theagilemonkeys.meets.magento.methods.CustomerCustomerCreate.java
com.theagilemonkeys.meets.magento.methods.CustomerCustomerInfo.java
com.theagilemonkeys.meets.magento.methods.CustomerCustomerList.java
com.theagilemonkeys.meets.magento.methods.CustomerCustomerUpdate.java
com.theagilemonkeys.meets.magento.methods.Products.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartCreate.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartCustomerAddresses.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartCustomerSet.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartInfo.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartOrder.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartPaymentList.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartPaymentMethod.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartProductAdd.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartProductRemove.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartShippingList.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartShippingMethod.java
com.theagilemonkeys.meets.magento.models.MageMeetsAddress.java
com.theagilemonkeys.meets.magento.models.MageMeetsCartItem.java
com.theagilemonkeys.meets.magento.models.MageMeetsCartPayment.java
com.theagilemonkeys.meets.magento.models.MageMeetsCartShipping.java
com.theagilemonkeys.meets.magento.models.MageMeetsCart.java
com.theagilemonkeys.meets.magento.models.MageMeetsCategory.java
com.theagilemonkeys.meets.magento.models.MageMeetsCustomer.java
com.theagilemonkeys.meets.magento.models.MageMeetsProduct.java
com.theagilemonkeys.meets.magento.models.MageStockInfoList.java
com.theagilemonkeys.meets.magento.models.MageStockItem.java
com.theagilemonkeys.meets.magento.models.base.MageMeetsCollectionPojos.java
com.theagilemonkeys.meets.magento.models.base.MageMeetsCollection.java
com.theagilemonkeys.meets.magento.models.base.MageMeetsFactory.java
com.theagilemonkeys.meets.magento.models.base.MageMeetsModel.java
com.theagilemonkeys.meets.models.MeetsAddress.java
com.theagilemonkeys.meets.models.MeetsCart.java
com.theagilemonkeys.meets.models.MeetsCategory.java
com.theagilemonkeys.meets.models.MeetsCustomer.java
com.theagilemonkeys.meets.models.MeetsProduct.java
com.theagilemonkeys.meets.models.MeetsStock.java
com.theagilemonkeys.meets.models.base.MeetsCollectionPojos.java
com.theagilemonkeys.meets.models.base.MeetsCollection.java
com.theagilemonkeys.meets.models.base.MeetsFactory.java
com.theagilemonkeys.meets.models.base.MeetsListener.java
com.theagilemonkeys.meets.models.base.MeetsModel.java
com.theagilemonkeys.meets.utils.Copier.java
com.theagilemonkeys.meets.utils.StringUtils.java
com.theagilemonkeys.meets.utils.soap.Serializable.java
com.theagilemonkeys.meets.utils.soap.SoapParser.java