1 /*
2  * Copyright (C) 2015 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.messaging.datamodel.data;
17 
18 import android.text.TextUtils;
19 
20 /**
21  * Holds data for conversation message bubble which keeps track of whether it's been bound to
22  * a new message.
23  */
24 public class ConversationMessageBubbleData {
25     private String mMessageId;
26 
27     /**
28      * Binds to ConversationMessageData instance.
29      * @return true if we are binding to a different message, false if we are binding to the
30      *         same message (e.g. in order to update the status text)
31      */
bind(final ConversationMessageData data)32     public boolean bind(final ConversationMessageData data) {
33         final boolean changed = !TextUtils.equals(mMessageId, data.getMessageId());
34         mMessageId = data.getMessageId();
35         return changed;
36     }
37 }
38