/** * Copyright 2011-2015 John Ericksen * * 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 org.androidtransfuse.intentFactory; import android.content.Context; import android.content.Intent; import android.os.Bundle; import java.util.List; /** * Strategy class defining a Contract for the given Android Context, specifying the relevant parameters to build an Android Intent. * * @author John Ericksen */ public interface IntentFactoryStrategy { String START_METHOD = "start"; String GET_TARGET_CONTEXT_METHOD = "getTargetContext"; String GET_EXTRAS_METHOD = "getExtras"; /** * Starts the relevant Android Context component by Intent. The given Intent will be generated by the * IntentFactory using parameters found in this instance. * * @param context current Context. * @param intent built Intent. */ void start(Context context, Intent intent); /** * Returns the Class representing the Context this Strategy is used to build an Intent for. * * @return Context Class */ Class<? extends Context> getTargetContext(); /** * Returns the relevant Extras defined by this Strategy class. * * @return Bundled Extras */ Bundle getExtras(); /** * Returns the associated Flags defined by the Strategy class. * * @return flags */ int getFlags(); /** * Returns a list of Categories defined by the Strategy class. * * @return categories */ List<String> getCategories(); }