示例#1
0
        /// <summary>
        /// Copy constructor.<br>
        /// Initializes the components list with a deep copy of the source components list. </summary>
        /// <param name="source"> a field instance to copy
        /// @since 7.7 </param>
        public static Field13C newInstance(Field13C source)
        {
            Field13C cp = new Field13C();

            cp.Components = new List <>(source.Components);
            return(cp);
        }
示例#2
0
        public static Field13C fromJson(string json)
        {
            Field13C   field      = new Field13C();
            JsonParser parser     = new JsonParser();
            JsonObject jsonObject = (JsonObject)parser.parse(json);

            if (jsonObject.get("code") != null)
            {
                field.Component1 = jsonObject.get("code").AsString;
            }
            if (jsonObject.get("time") != null)
            {
                field.setComponent2(jsonObject.get("time").AsString);
            }
            if (jsonObject.get("sign") != null)
            {
                field.Component3 = jsonObject.get("sign").AsString;
            }
            if (jsonObject.get("offset") != null)
            {
                field.setComponent4(jsonObject.get("offset").AsString);
            }
            return(field);
        }