예제 #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 Field19A newInstance(Field19A source)
        {
            Field19A cp = new Field19A();

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

            if (jsonObject.get("qualifier") != null)
            {
                field.Component1 = jsonObject.get("qualifier").AsString;
            }
            if (jsonObject.get("sign") != null)
            {
                field.Component2 = jsonObject.get("sign").AsString;
            }
            if (jsonObject.get("currency") != null)
            {
                field.setComponent3(jsonObject.get("currency").AsString);
            }
            if (jsonObject.get("amount") != null)
            {
                field.setComponent4(jsonObject.get("amount").AsString);
            }
            return(field);
        }