1a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda/* 2a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * Copyright (C) 2011 The Android Open Source Project 3a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * 4a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * Licensed under the Apache License, Version 2.0 (the "License"); 5a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * you may not use this file except in compliance with the License. 6a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * You may obtain a copy of the License at 7a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * 8a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * http://www.apache.org/licenses/LICENSE-2.0 9a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * 10a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * Unless required by applicable law or agreed to in writing, software 11a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * distributed under the License is distributed on an "AS IS" BASIS, 12a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * See the License for the specific language governing permissions and 14a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * limitations under the License 15a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda */ 16a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda 17a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerdapackage com.android.contacts.util; 18a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda 19a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda/** 20a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda * Builder for {@link StreamItemEntry}s to make writing tests easier. 21a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda */ 22a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerdapublic class StreamItemEntryBuilder { 23a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda private long mId; 24a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda private String mText; 25a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda private String mComment; 26a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda private long mTimestamp; 27d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann private String mAccountType; 28d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann private String mAccountName; 29d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann private String mDataSet; 30a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda private String mResPackage; 31d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann private String mIconRes; 32d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann private String mLabelRes; 33a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda 34a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda public StreamItemEntryBuilder() {} 35a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda 36d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann public StreamItemEntryBuilder setText(String value) { 37d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann mText = value; 38a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda return this; 39a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda } 40a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda 41d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann public StreamItemEntryBuilder setComment(String value) { 42d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann mComment = value; 43a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda return this; 44a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda } 45a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda 46d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann public StreamItemEntryBuilder setAccountType(String value) { 47d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann mAccountType = value; 48a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda return this; 49a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda } 50a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda 51d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann public StreamItemEntryBuilder setAccountName(String value) { 52d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann mAccountName = value; 53d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann return this; 54d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann } 55d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann 56d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann public StreamItemEntryBuilder setDataSet(String value) { 57d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann mDataSet = value; 58a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda return this; 59a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda } 60a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda 61a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda public StreamItemEntry build() { 62d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann return new StreamItemEntry(mId, mText, mComment, mTimestamp, mAccountType, mAccountName, 63d78ee90c0d4d93b82ad440396e87ae4f47f53e93Daniel Lehmann mDataSet, mResPackage, mIconRes, mLabelRes); 64a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda } 65a21993720988a5fc0b48594d1ff0ce6f932780b7Flavio Lerda}