Home | History | Annotate | Download | only in common
      1 /*
      2  * Copyright (c) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.ims.internal.uce.common;
     18 
     19 import android.os.Parcel;
     20 import android.os.Parcelable;
     21 import android.util.Log;
     22 
     23 
     24 /** Simple object wrapper for a long type.
     25  *  @hide */
     26 public class UceLong implements Parcelable {
     27 
     28     private long mUceLong;
     29     private int mClientId = 1001;
     30 
     31     /**
     32      * Constructor for the UceLong class.
     33      * @hide
     34      */
     35     public UceLong() {
     36     };
     37 
     38     /**
     39      * Gets the long value.
     40      * @hide
     41      */
     42     public long getUceLong() {
     43         return mUceLong;
     44     }
     45 
     46     /**
     47      * Sets the long value.
     48      * @hide
     49      */
     50     public void setUceLong(long uceLong) {
     51         this.mUceLong = uceLong;
     52     }
     53 
     54     /** Get the client ID as integer value.
     55      *  @hide
     56      */
     57     public int getClientId() {
     58         return mClientId;
     59     }
     60 
     61     /**
     62      * Set the client ID as integer value.
     63      * @hide
     64      */
     65     public void setClientId(int nClientId) {
     66         this.mClientId = nClientId;
     67     }
     68 
     69 
     70     /**
     71      * Gets the instance of a UceLong class.
     72      * @hide
     73      */
     74     public static UceLong getUceLongInstance() {
     75         return new UceLong();
     76     }
     77 
     78     /** @hide */
     79     public int describeContents() {
     80         return 0;
     81     }
     82 
     83     /** @hide */
     84     public void writeToParcel(Parcel dest, int flags) {
     85         writeToParcel(dest);
     86 
     87     }
     88 
     89     /** @hide */
     90     private void writeToParcel(Parcel out) {
     91         out.writeLong(mUceLong);
     92         out.writeInt(mClientId);
     93     }
     94 
     95     /** @hide */
     96     public static final Parcelable.Creator<UceLong> CREATOR =
     97                                     new Parcelable.Creator<UceLong>() {
     98 
     99         public UceLong createFromParcel(Parcel source) {
    100             return new UceLong(source);
    101         }
    102 
    103         public UceLong[] newArray(int size) {
    104             return new UceLong[size];
    105         }
    106     };
    107 
    108     /** @hide */
    109     private UceLong(Parcel source) {
    110         readFromParcel(source);
    111     }
    112 
    113     /** @hide */
    114     public void readFromParcel(Parcel source) {
    115         mUceLong = source.readLong();
    116         mClientId = source.readInt();
    117     }
    118 }
    119