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

org.ioc.commons.impl.android.flowcontrol.activitymapper.Place Maven / Gradle / Ivy

package org.ioc.commons.impl.android.flowcontrol.activitymapper;

import org.ioc.commons.flowcontrol.placecontroller.HasPlaceData;
import org.ioc.commons.flowcontrol.placecontroller.IsPlace;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

public class Place

> implements HasPlaceData { public enum Type { ACTIVITY_PLACE, FRAGMENT_PLACE, INTENT_PLACE; } private final P placeId; private final Class activity; private final Fragment fragment; private final Intent intent; private final Type type; private final Integer forResultRequestCode; private Bundle extras; public Place(P placeId, Class activity) { this(placeId, activity, null); } public Place(P placeId, Class activity, Integer forResultRequestCode) { this.placeId = placeId; this.activity = activity; this.fragment = null; this.intent = null; this.type = Type.ACTIVITY_PLACE; this.forResultRequestCode=forResultRequestCode; } public Place(P placeId, Fragment fragment) { this.placeId = placeId; this.activity = null; this.fragment = fragment; this.intent = null; this.type = Type.FRAGMENT_PLACE; this.forResultRequestCode = null; } public Place(P placeId, Intent intent) { this(placeId, intent, null); } public Place(P placeId, Intent intent, Integer forResultRequestCode) { this.placeId = placeId; this.activity = null; this.fragment = null; this.intent = intent; this.type = Type.INTENT_PLACE; this.forResultRequestCode = forResultRequestCode; } @Override public Enum getPlaceId() { return this.placeId; } public Class getActivity() { return activity; } public Fragment getFragment() { return fragment; } public Type getType() { return type; } public Intent getIntent() { return intent; } public Integer getForResultRequestCode() { return forResultRequestCode; } public Bundle getExtras() { return extras; } public void setExtras(Bundle extras) { this.extras = extras; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy