Example #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 Field109 newInstance(Field109 source)
        {
            Field109 cp = new Field109();

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

            if (jsonObject.get("date") != null)
            {
                field.setComponent1(jsonObject.get("date").AsString);
            }
            if (jsonObject.get("time") != null)
            {
                field.setComponent2(jsonObject.get("time").AsString);
            }
            if (jsonObject.get("mIR") != null)
            {
                field.Component3 = jsonObject.get("mIR").AsString;
            }
            return(field);
        }