All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.shipdream.lib.android.mvc.ModelKeeper Maven / Gradle / Ivy

Go to download

Controller module for AndroidMvc Framework. It doesn't depend on Android SDK thus app controller module depending on this module would do jUnit test easily on pure JVM.

The newest version!
/*
 * Copyright 2016 Kejun Xia
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.shipdream.lib.android.mvc;

/**
 * ModelKeeper can save model of objects implementing {@link MvcBean} into it. The model can
 * be got back from the keeper later on.
 */
public interface ModelKeeper {
    /**
     * Save model into this {@link ModelKeeper}
     * @param model The model to save
     * @param type The class type of the model
     * @param 
     */
     void saveModel(T model, Class type);

    /**
     * Retrieves model
     * @param type The class type of the model
     * @param 
     * @return null if the model with the given type has not been saved or a null model was saved,
     * otherwise returns model saved previously
     */
     T retrieveModel(Class type);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy