Back to project page C2Framework.
The source code is released under:
Apache License
If you think the Android project C2Framework 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 gaia.c2.context.view; /* w w w .jav a2 s. c om*/ import android.os.Bundle; import android.os.Parcelable; import java.util.List; import gaia.c2.receivers.ContextBroadcastReceiver; /** * Created by kmr on 4/7/14. */ public final class C2Message { private Bundle bundle; public C2Message(Bundle bundle) { if (bundle == null) { throw new NullPointerException("bundle == null"); } this.bundle = bundle; } public boolean isObject() { return bundle.getParcelable(ContextBroadcastReceiver.CONTENT_FIELD) != null; } public boolean isList() { return bundle.getParcelableArrayList(ContextBroadcastReceiver.CONTENT_FIELD_ARRAY) != null; } public <T extends Parcelable> T getObject(Class<T> type) { return (T) bundle.getParcelable(ContextBroadcastReceiver.CONTENT_FIELD); } public <T extends Parcelable> List<T> getList(Class<T> type) { return (List<T>) bundle.getParcelableArrayList(ContextBroadcastReceiver.CONTENT_FIELD_ARRAY); } public Exception getError() { return (Exception) bundle.getSerializable(ContextBroadcastReceiver.EXCEPTION_FIELD); } public String getMimeType() { return bundle.getString(ContextBroadcastReceiver.CONTENT_MIME_TYPE); } }