Use always whitespaces to indent the start of the line
Remove unnecessary whitespaces

Signed-off-by: Stefan Obermeier <scray@stefan-obermeier.de>
This commit is contained in:
Stefan Obermeier 2020-04-06 23:32:55 +02:00
parent 04bdd1d308
commit 1ada9a7ca3
No known key found for this signature in database
GPG key ID: FEE0FA3967170C38
2 changed files with 27 additions and 28 deletions

View file

@ -17,26 +17,26 @@ import com.owlike.genson.annotation.JsonProperty;
*/
@DataType()
public final class CarQueryResult {
@Property()
private final String key;
@Property()
private final Car record;
public CarQueryResult(@JsonProperty("Key") final String key, @JsonProperty("Record") final Car record) {
this.key = key;
this.record = record;
}
@Property()
private final String key;
@Property()
private final Car record;
public CarQueryResult(@JsonProperty("Key") final String key, @JsonProperty("Record") final Car record) {
this.key = key;
this.record = record;
}
public String getKey() {
return key;
}
return key;
}
public Car getRecord() {
return record;
}
public Car getRecord() {
return record;
}
@Override
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
@ -50,7 +50,7 @@ public final class CarQueryResult {
Boolean recordsAreEquals = this.getRecord().equals(other.getRecord());
Boolean keysAreEquals = this.getKey().equals(other.getKey());
return recordsAreEquals && keysAreEquals;
}
@ -58,11 +58,10 @@ public final class CarQueryResult {
public int hashCode() {
return Objects.hash(this.getKey(), this.getRecord());
}
@Override
public String toString() {
return "{\"Key\":\"" + key + "\"" + "\"Record\":{\"" + record + "}\"}";
}
}
@Override
public String toString() {
return "{\"Key\":\"" + key + "\"" + "\"Record\":{\"" + record + "}\"}";
}
}

View file

@ -146,14 +146,14 @@ public final class FabCar implements ContractInterface {
final String startKey = "CAR0";
final String endKey = "CAR999";
List<CarQueryResult> queryResults = new ArrayList<CarQueryResult>();
QueryResultsIterator<KeyValue> results = stub.getStateByRange(startKey, endKey);
for (KeyValue result: results) {
Car car = genson.deserialize(result.getStringValue(), Car.class);
queryResults.add(new CarQueryResult(result.getKey(), car));
}
CarQueryResult[] response = queryResults.toArray(new CarQueryResult[queryResults.size()]);
return response;