aboutsummaryrefslogtreecommitdiff
path: root/examples/ex6_complex_type_conversion/src/main/java/com/google/android/mobly/snippet/example6/CustomType.java
diff options
context:
space:
mode:
authorAng Li <angli@google.com>2018-01-12 11:54:03 -0800
committerGitHub <noreply@github.com>2018-01-12 11:54:03 -0800
commitc2d947efa173968571cbcc11376159647a9ff356 (patch)
treec8e06f22c7dffb5ffed4f7824120fb0dff8a5354 /examples/ex6_complex_type_conversion/src/main/java/com/google/android/mobly/snippet/example6/CustomType.java
parent4d02684ade1a312b39591a94a92328dc0b65b883 (diff)
downloadmobly-snippet-lib-c2d947efa173968571cbcc11376159647a9ff356.tar.gz
Support custom converters of non-primitive types. (#86)
Now users can supply custom logic for object serialization/de-serialization through a centralized class, and snippet lib will automatically use the custom converters. Added a new example to demonstrate this feature.
Diffstat (limited to 'examples/ex6_complex_type_conversion/src/main/java/com/google/android/mobly/snippet/example6/CustomType.java')
-rw-r--r--examples/ex6_complex_type_conversion/src/main/java/com/google/android/mobly/snippet/example6/CustomType.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/ex6_complex_type_conversion/src/main/java/com/google/android/mobly/snippet/example6/CustomType.java b/examples/ex6_complex_type_conversion/src/main/java/com/google/android/mobly/snippet/example6/CustomType.java
new file mode 100644
index 0000000..223b63e
--- /dev/null
+++ b/examples/ex6_complex_type_conversion/src/main/java/com/google/android/mobly/snippet/example6/CustomType.java
@@ -0,0 +1,21 @@
+package com.google.android.mobly.snippet.example6;
+
+/**
+ * A data class that defines a non-primitive type.
+ *
+ * This type is used to demonstrate serialization and de-serialization of complex type objects in
+ * Mobly Snippet Lib for Android.
+ */
+public class CustomType {
+ private String myValue;
+ CustomType(String value) {
+ myValue = value;
+ }
+
+ String getMyValue() {
+ return myValue;
+ }
+ public void setMyValue(String newValue) {
+ myValue = newValue;
+ }
+}