Android Open Source - C2Framework C2 Message






From Project

Back to project page C2Framework.

License

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.

Java Source Code

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);
    }
}




Java Source Code List

gaia.c2.content.C2ContentProvider.java
gaia.c2.content.C2ContentService.java
gaia.c2.content.QueryHandler.java
gaia.c2.content.android.CallContentProvider.java
gaia.c2.content.android.DialContentProvider.java
gaia.c2.content.android.VibrationContentProvider.java
gaia.c2.content.android.model.Call.java
gaia.c2.content.android.model.Dial.java
gaia.c2.content.android.model.Vibration.java
gaia.c2.content.model.ContextDependentModel.java
gaia.c2.content.sqlite.C2SQLiteContentProvider.java
gaia.c2.content.sqlite.C2SQLiteHelper.java
gaia.c2.content.tools.C2DownloadsContentProvider.java
gaia.c2.content.tools.model.DownloadStatus.java
gaia.c2.context.C2Context.java
gaia.c2.context.DefaultC2Context.java
gaia.c2.context.view.C2Message.java
gaia.c2.context.view.C2View.java
gaia.c2.receivers.ContextBroadcastReceiver.java
gaia.c2.receivers.ContextEventReceiver.java