1 /* 2 * Copyright (C) 2011 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 package com.android.contacts.group; 17 18 /** 19 * Meta-data for a contact group. We load all groups associated with the contact's 20 * constituent accounts. 21 */ 22 public final class GroupListItem { 23 private final String mAccountName; 24 private final String mAccountType; 25 private final String mDataSet; 26 private final long mGroupId; 27 private final String mTitle; 28 private final boolean mIsFirstGroupInAccount; 29 private final int mMemberCount; 30 31 public GroupListItem(String accountName, String accountType, String dataSet, long groupId, 32 String title, boolean isFirstGroupInAccount, int memberCount) { 33 mAccountName = accountName; 34 mAccountType = accountType; 35 mDataSet = dataSet; 36 mGroupId = groupId; 37 mTitle = title; 38 mIsFirstGroupInAccount = isFirstGroupInAccount; 39 mMemberCount = memberCount; 40 } 41 42 public String getAccountName() { 43 return mAccountName; 44 } 45 46 public String getAccountType() { 47 return mAccountType; 48 } 49 50 public String getDataSet() { 51 return mDataSet; 52 } 53 54 public long getGroupId() { 55 return mGroupId; 56 } 57 58 public String getTitle() { 59 return mTitle; 60 } 61 62 public int getMemberCount() { 63 return mMemberCount; 64 } 65 66 public boolean hasMemberCount() { 67 return mMemberCount != -1; 68 } 69 70 public boolean isFirstGroupInAccount() { 71 return mIsFirstGroupInAccount; 72 } 73 }