/// <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 Field22K newInstance(Field22K source) { Field22K cp = new Field22K(); cp.Components = new List <>(source.Components); return(cp); }
public static Field22K fromJson(string json) { Field22K field = new Field22K(); JsonParser parser = new JsonParser(); JsonObject jsonObject = (JsonObject)parser.parse(json); if (jsonObject.get("typeOfEvent") != null) { field.Component1 = jsonObject.get("typeOfEvent").AsString; } if (jsonObject.get("narrative") != null) { field.Component2 = jsonObject.get("narrative").AsString; } return(field); }