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

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

            if (jsonObject.get("code1") != null)
            {
                field.Component1 = jsonObject.get("code1").AsString;
            }
            if (jsonObject.get("code2") != null)
            {
                field.Component2 = jsonObject.get("code2").AsString;
            }
            if (jsonObject.get("code3") != null)
            {
                field.Component3 = jsonObject.get("code3").AsString;
            }
            if (jsonObject.get("currency") != null)
            {
                field.setComponent4(jsonObject.get("currency").AsString);
            }
            return(field);
        }