package com.kii.thingif.command;

/**
 * Marks a class as group of actions of command. The class implements Acton defines single actions
 * as fields of the class.
 * <p>The class must define {@link ActionAnnotation} for each field of the class, SDK uses the
 * defined annotations to serialize the class to json data or deserialize json data to a instance
 * of the class.
 *
 * <h3>Serialize Principles</h3>
 * <ul>
 *     <li>Name of action after serialized.
 *     <ul>
 *         <li>
 *             If value of actionName of {@link ActionAnnotation} is not an empty string, SDK uses
 *             this value as key of action in serialized json object.
 *         </li>
 *         <li>
 *             If value of actionName annotation is empty string, SDK will name of attribute of
 *             the class as key of action in serialized json object.
 *         </li>
 *     </ul>
 *     </li>
 *     <li>Value of action is serialized with Gson.
 *     <ul>
 *         <li>
 *             If action value is null, SDK does not include the action into serialized json data.
 *         </li>
 *         <li>
 *             If action value is primitive type(like int, boolean, float, double), SDK serializes
 *             it by its type.
 *         </li>
 *         <li>
 *             If action value is simple data type(like String, Number or subclass of Number(Integer,
 *             Float, etc.)), SDK serializes it by its type.
 *         </li>
 *         <li>
 *             If action value is customized object defined by developer, SDK serializes it using Gson.
 *         </li>
 *         <li>
 *            If action value is Collection type, SDK serializes it using Gson.
 *         </li>
 *         <li>
 *            If action value is array(like int[]), SDK serialized it using Gson.
 *         </li>
 *     </ul>
 *     </li>
 * </ul>
 */
public interface Action {
}

@@ -340,16 +340,17 @@
 ata to a
+n
  instanc
@@ -367,16 +367,111 @@
 e class.
+ During serialize or deserialize process, SDK treat filed of the class as action of%0A * command.
 %0A *%0A * %3C
@@ -649,14 +649,52 @@
 on%7D 
-is not
+for the field of class is not%0A *            
  an 
@@ -715,31 +715,16 @@
 SDK uses
-%0A *            
  this va
@@ -891,20 +891,17 @@
  of 
-attribute of
+the field
 %0A * 
@@ -912,26 +912,16 @@
         
-the class 
 as key o
@@ -1026,18 +1026,21 @@
  action 
-is
+after
  seriali
@@ -1047,17 +1047,17 @@
 zed 
-with Gson
+the field
 .%0A *
@@ -1096,36 +1096,42 @@
          If 
-action value
+value of the field
  is null, SD
@@ -1145,32 +1145,8 @@
 not 
-include the action into 
 seri
@@ -1152,25 +1152,26 @@
 ialized 
-json data
+this field
 .%0A *    
@@ -1219,118 +1219,216 @@
  If 
-action value is primitive type(like int, boolean, float, double), SDK serializes%0A *             it by its type
+value of the field is not null, SDK serialize this field using%0A *             %3Ca href=%22https://github.com/google/gson/blob/master/UserGuide.md#TOC-Object-Examples%22%3E%0A *                 Gson%0A *             %3C/a%3E
 .%0A *
@@ -1453,429 +1453,728 @@
     
+%3C/ul%3E%0A *
     
-%3C
+ %3C/
 li%3E%0A * 
-            If action value is simple data type(like String, Number or subclass of Number(Integer,%0A *             Float, etc.)), SDK serializes it by its type.%0A *         %3C/li%3E%0A *         %3Cli%3E%0A *             If action value is customized object defined by developer, SDK serializes it using Gson.%0A *         %3C/li%3E%0A *         %3Cli%3E%0A *            If action value is Collection type, SDK serializes it using
+%3C/ul%3E%0A * %3Ch3%3EDeserialize Steps%3C/h3%3E%0A * %3Cul%3E%0A *     %3Cli%3EFind the field of the class to deserialize action.%0A *     %3Cul%3E%0A *         %3Cli%3EFirst find the fields defined with %7B@link ActionAnnotation%7D and actionName value is%0A *         not empty. If one of the fields match, then deserialize the action to this field.%0A *         %3C/li%3E%0A *         %3Cli%3EIf no field found in the above step, then find the name of field. If the name is%0A *         matched, then deserialize the action to this field.%0A *         %3C/li%3E%0A *     %3C/ul%3E%0A *     %3C/li%3E%0A *     %3Cli%3EDeserialize value of the matched field using%0A *         %3Ca href=%22https://github.com/google/gson/blob/master/UserGuide.md#TOC-Object-Examples%22%3E%0A *        
  Gson
-.
 %0A * 
@@ -2175,34 +2175,46 @@
 on%0A *         %3C/
+a%3E.%0A *     %3Cu
 l
-i
 %3E%0A *         %3Cli
@@ -2252,55 +2252,72 @@
  is 
-array(like int%5B%5D), SDK serialized it using Gson
+Collection type, the type of acton must be registered in advance
 .%0A *

Improve description of Action interface