diff options
author | Tarun Gupta <tarun1995gupta@gmail.com> | 2015-03-18 10:36:41 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2015-03-19 18:28:55 (GMT) |
commit | d62c9ba2dad0d9833c76452b5aa780a215548a5e (patch) | |
tree | ff0ad21e1394dc2202c1d1e14d169c577a313b96 /src/com/isode/stroke/elements | |
parent | 07117577091cee230bb0da8245856e19a9c7da8c (diff) | |
download | stroke-d62c9ba2dad0d9833c76452b5aa780a215548a5e.zip stroke-d62c9ba2dad0d9833c76452b5aa780a215548a5e.tar.bz2 |
Add functionality for ChatState.
Adds the Element, Parser, Serializer, ChatStateTracker and ChatStateSerializerTest.
License:
This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Test-Information:
Ported serializer test from Swiften, which passes.
Change-Id: I314eda2db0f2be0499f8aa74d043319fb5cf57a8
Diffstat (limited to 'src/com/isode/stroke/elements')
-rw-r--r-- | src/com/isode/stroke/elements/ChatState.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/com/isode/stroke/elements/ChatState.java b/src/com/isode/stroke/elements/ChatState.java new file mode 100644 index 0000000..151eec4 --- /dev/null +++ b/src/com/isode/stroke/elements/ChatState.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ +/* + * Copyright (c) 2015 Tarun Gupta. + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +package com.isode.stroke.elements; + +import com.isode.stroke.base.NotNull; +import com.isode.stroke.elements.Payload; + +public class ChatState extends Payload { + + public enum ChatStateType {Active, Composing, Paused, Inactive, Gone}; + + private ChatStateType state_; + + /** + * ChatState(); + */ + public ChatState() { + state_ = ChatStateType.Active; + } + + /** + * ChatState(state); + */ + public ChatState(ChatStateType state) { + NotNull.exceptIfNull(state, "state"); + state_ = state; + } + + /** + * + * @return state, notnull. + */ + public ChatStateType getChatState() { + return state_; + } + + /** + * + * @param state, notnull. + */ + public void setChatState(ChatStateType state) { + NotNull.exceptIfNull(state, "state"); + state_ = state; + } +}
\ No newline at end of file |