java - Setter changes value of the field only in scope of the setter -


I have an app that receives the message There are fields in the message that may be editable. When the field changes, it must be saved in the database. Unfortunately, Setter has changed the value of the given field to the setter's realm only. Any idea why this happens? This recipient and setter code is:

  get public stringSecondor charge () {tag tag = swiftMessage.getBlock4 (). GetTagByName ("71F"); String value = tag. GetValue (); Field71F field = new field 71F (value); String sender charge = field. GetValue (); Return sender charge; } Public Zero Set Sensor Charge (String Sender Charges) {Tag Tag = Swift Message .getBlock4 (). GetTagByName ("71F"); String value = tag. GetValue (); If (value.equals (sender charging)) {tag.setValue (value); } Other {tag .setValue (sender charging); }}    

You are creating a new object of the tag in the setter method So when you organize the tag method in tag.setValu e, the setter does not represent the method outside.

Tag Setter is local for the method and it is not the outside scope of the setter method.

Try this type -

  Public Zero Setsetter Charge (String Sender Charge) {String Value = Swift Message. GetBlock4 (). GetTagByName ("71F") .getValue (); If (! Value.equals (Sender Charge)) {Swift Message Gateblock 4 (). GetTagByName ("71F") set value (sender charge); }}    

Comments