1 /* 2 * Copyright (C) 2007 Esmertec AG. 3 * Copyright (C) 2007 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package com.android.im.engine; 18 19 import android.os.Parcel; 20 import android.os.Parcelable; 21 22 public class Invitation implements Parcelable { 23 private String mId; 24 private Address mGroupAddress; 25 private Address mSender; 26 private String mReason; 27 28 public Invitation(String id, Address groupAddress, Address sender, 29 String resean) { 30 mId = id; 31 mGroupAddress = groupAddress; 32 mSender = sender; 33 mReason = resean; 34 } 35 36 public Invitation(Parcel source) { 37 mId = source.readString(); 38 mGroupAddress = AddressParcelHelper.readFromParcel(source); 39 mSender = AddressParcelHelper.readFromParcel(source); 40 mReason = source.readString(); 41 } 42 43 public String getInviteID() { 44 return mId; 45 } 46 47 public Address getGroupAddress() { 48 return mGroupAddress; 49 } 50 51 public Address getSender() { 52 return mSender; 53 } 54 55 public String getReason() { 56 return mReason; 57 } 58 59 public void writeToParcel(Parcel dest, int flags) { 60 dest.writeString(mId); 61 AddressParcelHelper.writeToParcel(dest, mGroupAddress); 62 AddressParcelHelper.writeToParcel(dest, mSender); 63 dest.writeString(mReason); 64 } 65 66 public int describeContents() { 67 return 0; 68 } 69 70 public static final Parcelable.Creator<Invitation> CREATOR = new Parcelable.Creator<Invitation>() { 71 public Invitation createFromParcel(Parcel source) { 72 return new Invitation(source); 73 } 74 75 public Invitation[] newArray(int size) { 76 return new Invitation[size]; 77 } 78 }; 79 } 80