Code example for Parcel

Methods: readBooleanArray, readString

0
        mCapability = null;
        mDescription = null;
        mName = null;
 
        boolean[] validDataList = new boolean[MemberData.values().length];
        in.readBooleanArray(validDataList);
 
        if (validDataList[MemberData.VALUE.ordinal()]) {
            boolean[] b = new boolean[1];
            in.readBooleanArray(b);
            mValue = b[0];
        } 
        if (validDataList[MemberData.CAPABILITY.ordinal()]) {
            String cap = in.readString();
            mCapability = CapabilityID.valueOf(cap);
        } 
        if (validDataList[MemberData.DESCRIPTION.ordinal()]) {
            mDescription = in.readString();
        } 
        if (validDataList[MemberData.NAME.ordinal()]) {
            mName = in.readString();
        } 
    } 
 
    /** 
     * Interface to allow IdentityCapability to be written and restored from a