Example #1
0
        public static Field22C fromJson(string json)
        {
            Field22C   field      = new Field22C();
            JsonParser parser     = new JsonParser();
            JsonObject jsonObject = (JsonObject)parser.parse(json);

            if (jsonObject.get("partyPrefix1") != null)
            {
                field.Component1 = jsonObject.get("partyPrefix1").AsString;
            }
            if (jsonObject.get("partySuffix1") != null)
            {
                field.Component2 = jsonObject.get("partySuffix1").AsString;
            }
            if (jsonObject.get("referenceCode") != null)
            {
                field.setComponent3(jsonObject.get("referenceCode").AsString);
            }
            if (jsonObject.get("partyPrefix2") != null)
            {
                field.Component4 = jsonObject.get("partyPrefix2").AsString;
            }
            if (jsonObject.get("partySuffix2") != null)
            {
                field.Component5 = jsonObject.get("partySuffix2").AsString;
            }
            return(field);
        }
Example #2
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 Field22C newInstance(Field22C source)
        {
            Field22C cp = new Field22C();

            cp.Components = new List <>(source.Components);
            return(cp);
        }