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;
import java.util.ArrayList;
import java.util.List;
//import java.util.ArrayList;
//import java.util.List;
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.License;
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.ChaincodeStub;
import org.hyperledger.fabric.shim.ledger.KeyValue;
import org.hyperledger.fabric.shim.ledger.QueryResultsIterator;
//import org.hyperledger.fabric.shim.ledger.KeyValue;
//import org.hyperledger.fabric.shim.ledger.QueryResultsIterator;
import com.owlike.genson.Genson;
@ -52,7 +52,7 @@ public final class ClaimProcessing implements ContractInterface {
public void InitLedger(final Context ctx) {
ChaincodeStub stub = ctx.getStub();
CreateClaim(ctx, "cl-1", "v-123", 1, "ins-1", 3000);
CreateClaim(ctx, "cl-1", "v-123", 1, "ins-1", 3000);
}
@ -101,4 +101,4 @@ public final class ClaimProcessing implements ContractInterface {
return claim;
}
}
}

View file

@ -4,7 +4,7 @@
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.Property;
@ -50,8 +50,6 @@ public final class InsClaim {
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) {
this.claimID = claimID;
this.vin = vin;
@ -75,32 +73,43 @@ public final class InsClaim {
@Override
public boolean equals(final Object obj) {
if (this == obj)
if (this == obj){
return true;
if (obj == null)
}
if (obj == null){
return false;
if (getClass() != obj.getClass())
}
if (getClass() != obj.getClass()){
return false;
}
InsClaim other = (InsClaim) obj;
if (claimAmount != other.claimAmount)
if (claimAmount != other.claimAmount){
return false;
}
if (claimID == null) {
if (other.claimID != null)
if (other.claimID != null){
return false;
} else if (!claimID.equals(other.claimID))
}
} else if (!claimID.equals(other.claimID)){
return false;
if (custId != other.custId)
}
if (custId != other.custId){
return false;
}
if (insuranceId == null) {
if (other.insuranceId != null)
if (other.insuranceId != null){
return false;
} else if (!insuranceId.equals(other.insuranceId))
}
} else if (!insuranceId.equals(other.insuranceId)){
return false;
}
if (vin == null) {
if (other.vin != null)
if (other.vin != null){
return false;
} else if (!vin.equals(other.vin))
}
} else if (!vin.equals(other.vin)){
return false;
}
return true;
}
@ -110,5 +119,4 @@ public final class InsClaim {
+ insuranceId + ", vin=" + vin + "]";
}
}