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