/// <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 Field280 newInstance(Field280 source) { Field280 cp = new Field280(); cp.Components = new List <>(source.Components); return(cp); }
public static Field280 fromJson(string json) { Field280 field = new Field280(); JsonParser parser = new JsonParser(); JsonObject jsonObject = (JsonObject)parser.parse(json); if (jsonObject.get("inputTime") != null) { field.setComponent1(jsonObject.get("inputTime").AsString); } if (jsonObject.get("mIR") != null) { field.setComponent2(jsonObject.get("mIR").AsString); } if (jsonObject.get("accepted") != null) { field.setComponent3(jsonObject.get("accepted").AsString); } if (jsonObject.get("error") != null) { field.Component4 = jsonObject.get("error").AsString; } return(field); }