fixed formatting issues

This commit is contained in:
Aniket Anerao 2022-08-24 22:29:46 +05:30
parent ff8d083555
commit 45180358ca
2 changed files with 30 additions and 22 deletions

View file

@ -1,7 +1,7 @@
package org.hyperledger.fabric.samples.insfraudcheck; package org.hyperledger.fabric.samples.insfraudcheck;
import java.util.ArrayList; //import java.util.ArrayList;
import java.util.List; //import java.util.List;
import org.hyperledger.fabric.contract.Context; import org.hyperledger.fabric.contract.Context;
@ -12,11 +12,11 @@ import org.hyperledger.fabric.contract.annotation.Default;
import org.hyperledger.fabric.contract.annotation.Info; import org.hyperledger.fabric.contract.annotation.Info;
import org.hyperledger.fabric.contract.annotation.License; import org.hyperledger.fabric.contract.annotation.License;
import org.hyperledger.fabric.contract.annotation.Transaction; import org.hyperledger.fabric.contract.annotation.Transaction;
import org.hyperledger.fabric.samples.insfraudcheck.InsClaim; //import org.hyperledger.fabric.samples.insfraudcheck.InsClaim;
import org.hyperledger.fabric.shim.ChaincodeException; import org.hyperledger.fabric.shim.ChaincodeException;
import org.hyperledger.fabric.shim.ChaincodeStub; import org.hyperledger.fabric.shim.ChaincodeStub;
import org.hyperledger.fabric.shim.ledger.KeyValue; //import org.hyperledger.fabric.shim.ledger.KeyValue;
import org.hyperledger.fabric.shim.ledger.QueryResultsIterator; //import org.hyperledger.fabric.shim.ledger.QueryResultsIterator;
import com.owlike.genson.Genson; import com.owlike.genson.Genson;

View file

@ -4,7 +4,7 @@
package org.hyperledger.fabric.samples.insfraudcheck; package org.hyperledger.fabric.samples.insfraudcheck;
import java.util.Objects; //import java.util.Objects;
import org.hyperledger.fabric.contract.annotation.DataType; import org.hyperledger.fabric.contract.annotation.DataType;
import org.hyperledger.fabric.contract.annotation.Property; import org.hyperledger.fabric.contract.annotation.Property;
@ -50,8 +50,6 @@ public final class InsClaim {
return claimAmount; return claimAmount;
} }
public InsClaim(@JsonProperty("claimID") final String claimID, @JsonProperty("vin") final String vin, @JsonProperty("custId") final int custId, @JsonProperty("insuranceId") final String insuranceId, @JsonProperty("claimAmount") final int claimAmount) { public InsClaim(@JsonProperty("claimID") final String claimID, @JsonProperty("vin") final String vin, @JsonProperty("custId") final int custId, @JsonProperty("insuranceId") final String insuranceId, @JsonProperty("claimAmount") final int claimAmount) {
this.claimID = claimID; this.claimID = claimID;
this.vin = vin; this.vin = vin;
@ -75,32 +73,43 @@ public final class InsClaim {
@Override @Override
public boolean equals(final Object obj) { public boolean equals(final Object obj) {
if (this == obj) if (this == obj){
return true; return true;
if (obj == null) }
if (obj == null){
return false; return false;
if (getClass() != obj.getClass()) }
if (getClass() != obj.getClass()){
return false; return false;
}
InsClaim other = (InsClaim) obj; InsClaim other = (InsClaim) obj;
if (claimAmount != other.claimAmount) if (claimAmount != other.claimAmount){
return false; return false;
}
if (claimID == null) { if (claimID == null) {
if (other.claimID != null) if (other.claimID != null){
return false; return false;
} else if (!claimID.equals(other.claimID)) }
} else if (!claimID.equals(other.claimID)){
return false; return false;
if (custId != other.custId) }
if (custId != other.custId){
return false; return false;
}
if (insuranceId == null) { if (insuranceId == null) {
if (other.insuranceId != null) if (other.insuranceId != null){
return false; return false;
} else if (!insuranceId.equals(other.insuranceId)) }
} else if (!insuranceId.equals(other.insuranceId)){
return false; return false;
}
if (vin == null) { if (vin == null) {
if (other.vin != null) if (other.vin != null){
return false; return false;
} else if (!vin.equals(other.vin)) }
} else if (!vin.equals(other.vin)){
return false; return false;
}
return true; return true;
} }
@ -110,5 +119,4 @@ public final class InsClaim {
+ insuranceId + ", vin=" + vin + "]"; + insuranceId + ", vin=" + vin + "]";
} }
} }