Madan Jampani

Fixed checkstyle issues

......@@ -8,7 +8,7 @@ import com.google.common.collect.Lists;
/**
* Collection of read requests to be submitted as one batch.
*/
public class BatchReadRequest {
public final class BatchReadRequest {
private final List<ReadRequest> readRequests;
......@@ -60,7 +60,7 @@ public class BatchReadRequest {
}
/**
* Builds a BatchReadRequest
* Builds a BatchReadRequest.
* @return BatchReadRequest
*/
public BatchReadRequest build() {
......
......@@ -3,6 +3,9 @@ package org.onlab.onos.store.service;
import java.util.Collections;
import java.util.List;
/**
* Result of a batch read operation.
*/
public class BatchReadResult {
private final List<ReadResult> readResults;
......@@ -11,10 +14,18 @@ public class BatchReadResult {
this.readResults = Collections.unmodifiableList(readResults);
}
/**
* Returns the results as a list.
* @return list of results
*/
public List<ReadResult> getAsList() {
return readResults;
}
/**
* Returns the batch size.
* @return batch size
*/
public int batchSize() {
return readResults.size();
}
......
......@@ -8,7 +8,7 @@ import com.google.common.collect.Lists;
/**
* Collection of write requests to be submitted as one batch.
*/
public class BatchWriteRequest {
public final class BatchWriteRequest {
private final List<WriteRequest> writeRequests;
......
......@@ -3,6 +3,9 @@ package org.onlab.onos.store.service;
import java.util.Collections;
import java.util.List;
/**
* Result of a batch write operation.
*/
public class BatchWriteResult {
private final List<WriteResult> writeResults;
......@@ -11,6 +14,10 @@ public class BatchWriteResult {
this.writeResults = Collections.unmodifiableList(writeResults);
}
/**
* Returns true if this batch write operation was successful.
* @return true if successful, false otherwise.
*/
public boolean isSuccessful() {
for (WriteResult result : writeResults) {
if (result.status() != WriteStatus.OK) {
......@@ -20,10 +27,18 @@ public class BatchWriteResult {
return true;
}
/**
* Returns the results as a List.
* @return list of batch results.
*/
public List<WriteResult> getAsList() {
return this.writeResults;
}
/**
* Returns the size of this batch.
* @return batch size.
*/
public int batchSize() {
return writeResults.size();
}
......