Home | History | Annotate | Download | only in group
      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     private final boolean mIsReadOnly;
     31     private final String mSystemId;
     32 
     33     public GroupListItem(String accountName, String accountType, String dataSet, long groupId,
     34             String title, boolean isFirstGroupInAccount, int memberCount, boolean isReadOnly,
     35             String systemId) {
     36         mAccountName = accountName;
     37         mAccountType = accountType;
     38         mDataSet = dataSet;
     39         mGroupId = groupId;
     40         mTitle = title;
     41         mIsFirstGroupInAccount = isFirstGroupInAccount;
     42         mMemberCount = memberCount;
     43         mIsReadOnly = isReadOnly;
     44         mSystemId = systemId;
     45     }
     46 
     47     public String getAccountName() {
     48         return mAccountName;
     49     }
     50 
     51     public String getAccountType() {
     52         return mAccountType;
     53     }
     54 
     55     public String getDataSet() {
     56         return mDataSet;
     57     }
     58 
     59     public long getGroupId() {
     60         return mGroupId;
     61     }
     62 
     63     public String getTitle() {
     64         return mTitle;
     65     }
     66 
     67     public int getMemberCount() {
     68         return mMemberCount;
     69     }
     70 
     71     public boolean hasMemberCount() {
     72         return mMemberCount != -1;
     73     }
     74 
     75     public boolean isFirstGroupInAccount() {
     76         return mIsFirstGroupInAccount;
     77     }
     78 
     79     public boolean isReadOnly() {
     80         return mIsReadOnly;
     81     }
     82 
     83     public String getSystemId() {
     84         return mSystemId;
     85     }
     86 }