/// <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 Field28C newInstance(Field28C source) { Field28C cp = new Field28C(); cp.Components = new List <>(source.Components); return(cp); }
/// <summary> /// This method deserializes the JSON data into a Field28C object. </summary> /// <param name="json"> JSON structure including tuples with label and value for all field components </param> /// <returns> a new field instance with the JSON data parsed into field components or an empty field id the JSON is invalid /// @since 7.10.3 </returns> /// <seealso cref= Field#fromJson(String) </seealso> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET: //ORIGINAL LINE: public static Field28C fromJson(final String json) public static Field28C fromJson(string json) { Field28C field = new Field28C(); JsonParser parser = new JsonParser(); JsonObject jsonObject = (JsonObject)parser.parse(json); if (jsonObject.get("statementNumber") != null) { field.setComponent1(jsonObject.get("statementNumber").AsString); } if (jsonObject.get("sequenceNumber") != null) { field.setComponent2(jsonObject.get("sequenceNumber").AsString); } return(field); }