summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarun Gupta <tarun1995gupta@gmail.com>2015-06-19 05:56:31 (GMT)
committerTarun Gupta <tarun1995gupta@gmail.com>2015-06-23 14:55:01 (GMT)
commit27212e007077418d18014286a46723fa26693864 (patch)
tree7e70d70f760a2d35617ec8d17c7d6b322a8c3c16 /src/com/isode/stroke/elements
parentbc9dade982d8e8efe66c0fc814dafd8bf079e689 (diff)
downloadstroke-27212e007077418d18014286a46723fa26693864.zip
stroke-27212e007077418d18014286a46723fa26693864.tar.bz2
Adds Carbons Element.
Adds: CarbonsDisable Element, its Parser and Serializer. CarbonsEnable Element, its Parser and Serializer. CarbonsPrivate Element, its Parser and Serializer. CarbonsReceived Element, its Parser and Serializer. CarbonsSent Element, its Parser and Serializer. Thread Element, its Parser and Serializer. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for CarbonsParser and CarbonsSerializers, which tests all the above functionalities and passes. Change-Id: I101b1b34c24515d5ba19a995254755af77c4e6e1
Diffstat (limited to 'src/com/isode/stroke/elements')
-rw-r--r--src/com/isode/stroke/elements/CarbonsDisable.java19
-rw-r--r--src/com/isode/stroke/elements/CarbonsEnable.java19
-rw-r--r--src/com/isode/stroke/elements/CarbonsPrivate.java19
-rw-r--r--src/com/isode/stroke/elements/CarbonsReceived.java43
-rw-r--r--src/com/isode/stroke/elements/CarbonsSent.java43
-rw-r--r--src/com/isode/stroke/elements/Thread.java78
6 files changed, 221 insertions, 0 deletions
diff --git a/src/com/isode/stroke/elements/CarbonsDisable.java b/src/com/isode/stroke/elements/CarbonsDisable.java
new file mode 100644
index 0000000..d88d14f
--- /dev/null
+++ b/src/com/isode/stroke/elements/CarbonsDisable.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015 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.elements.Payload;
+
+public class CarbonsDisable extends Payload {
+
+
+} \ No newline at end of file
diff --git a/src/com/isode/stroke/elements/CarbonsEnable.java b/src/com/isode/stroke/elements/CarbonsEnable.java
new file mode 100644
index 0000000..a637439
--- /dev/null
+++ b/src/com/isode/stroke/elements/CarbonsEnable.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015 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.elements.Payload;
+
+public class CarbonsEnable extends Payload {
+
+
+} \ No newline at end of file
diff --git a/src/com/isode/stroke/elements/CarbonsPrivate.java b/src/com/isode/stroke/elements/CarbonsPrivate.java
new file mode 100644
index 0000000..bf8e473
--- /dev/null
+++ b/src/com/isode/stroke/elements/CarbonsPrivate.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015 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.elements.Payload;
+
+public class CarbonsPrivate extends Payload {
+
+
+} \ No newline at end of file
diff --git a/src/com/isode/stroke/elements/CarbonsReceived.java b/src/com/isode/stroke/elements/CarbonsReceived.java
new file mode 100644
index 0000000..5e36583
--- /dev/null
+++ b/src/com/isode/stroke/elements/CarbonsReceived.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015 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.elements.Payload;
+import com.isode.stroke.elements.Forwarded;
+import com.isode.stroke.base.NotNull;
+
+public class CarbonsReceived extends Payload {
+
+ private Forwarded forwarded_;
+
+ /**
+ * Default Constructor.
+ */
+ public CarbonsReceived() {
+
+ }
+
+ /**
+ * @param forwarded, Not Null.
+ */
+ public void setForwarded(Forwarded forwarded) {
+ NotNull.exceptIfNull(forwarded, "forwarded");
+ forwarded_ = forwarded;
+ }
+
+ /**
+ * @return forwarded, Not Null.
+ */
+ public Forwarded getForwarded() {
+ return forwarded_;
+ }
+} \ No newline at end of file
diff --git a/src/com/isode/stroke/elements/CarbonsSent.java b/src/com/isode/stroke/elements/CarbonsSent.java
new file mode 100644
index 0000000..1d7d846
--- /dev/null
+++ b/src/com/isode/stroke/elements/CarbonsSent.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015 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.elements.Payload;
+import com.isode.stroke.elements.Forwarded;
+import com.isode.stroke.base.NotNull;
+
+public class CarbonsSent extends Payload {
+
+ private Forwarded forwarded_;
+
+ /**
+ * Default Constructor.
+ */
+ public CarbonsSent() {
+
+ }
+
+ /**
+ * @param forwarded, Not Null.
+ */
+ public void setForwarded(Forwarded forwarded) {
+ NotNull.exceptIfNull(forwarded, "forwarded");
+ forwarded_ = forwarded;
+ }
+
+ /**
+ * @return forwarded, Not Null.
+ */
+ public Forwarded getForwarded() {
+ return forwarded_;
+ }
+} \ No newline at end of file
diff --git a/src/com/isode/stroke/elements/Thread.java b/src/com/isode/stroke/elements/Thread.java
new file mode 100644
index 0000000..40eeb8b
--- /dev/null
+++ b/src/com/isode/stroke/elements/Thread.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2015 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.elements.Payload;
+import com.isode.stroke.base.NotNull;
+
+public class Thread extends Payload {
+
+ private String text_ = "";
+ private String parent_ = "";
+
+ /**
+ * Default Constructor.
+ */
+ public Thread() {
+ this("", "");
+ }
+
+ /**
+ * Parameterized Constructor.
+ * @param text, Not Null.
+ */
+ public Thread(String text) {
+ this(text, "");
+ }
+
+ /**
+ * Parameterized Constructor.
+ * @param text, Not Null.
+ * @param parent, not Null.
+ */
+ public Thread(String text, String parent) {
+ NotNull.exceptIfNull(text, "text");
+ NotNull.exceptIfNull(parent, "parent");
+ this.text_ = text;
+ this.parent_ = parent;
+ }
+
+ /**
+ * @param text, not Null.
+ */
+ public void setText(String text) {
+ NotNull.exceptIfNull(text, "text");
+ text_ = text;
+ }
+
+ /**
+ * @return text, not Null.
+ */
+ public String getText() {
+ return text_;
+ }
+
+ /**
+ * @param parent, not Null.
+ */
+ public void setParent(String parent) {
+ NotNull.exceptIfNull(parent, "parent");
+ parent_ = parent;
+ }
+
+ /**
+ * @return parent, not Null.
+ */
+ public String getParent() {
+ return parent_;
+ }
+} \ No newline at end of file