Skip to content

Commit ef98269

Browse files
committed
Rename maxResults to pageSize, add tests for pagination
1 parent 912ec8b commit ef98269

File tree

3 files changed

+298
-37
lines changed

3 files changed

+298
-37
lines changed

gcloud-java-compute/src/main/java/com/google/gcloud/compute/Compute.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,8 @@ public static DiskTypeListOption filter(DiskTypeFilter filter) {
597597
/**
598598
* Returns an option to specify the maximum number of disk types to be returned.
599599
*/
600-
public static DiskTypeListOption maxResults(long maxResults) {
601-
return new DiskTypeListOption(ComputeRpc.Option.MAX_RESULTS, maxResults);
600+
public static DiskTypeListOption pageSize(long pageSize) {
601+
return new DiskTypeListOption(ComputeRpc.Option.MAX_RESULTS, pageSize);
602602
}
603603

604604
/**
@@ -642,8 +642,8 @@ public static DiskTypeAggregatedListOption filter(DiskTypeFilter filter) {
642642
/**
643643
* Returns an option to specify the maximum number of disk types to be returned.
644644
*/
645-
public static DiskTypeAggregatedListOption maxResults(long maxResults) {
646-
return new DiskTypeAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, maxResults);
645+
public static DiskTypeAggregatedListOption pageSize(long pageSize) {
646+
return new DiskTypeAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize);
647647
}
648648

649649
/**
@@ -697,8 +697,8 @@ public static MachineTypeListOption filter(MachineTypeFilter filter) {
697697
/**
698698
* Returns an option to specify the maximum number of machine types to be returned.
699699
*/
700-
public static MachineTypeListOption maxResults(long maxResults) {
701-
return new MachineTypeListOption(ComputeRpc.Option.MAX_RESULTS, maxResults);
700+
public static MachineTypeListOption pageSize(long pageSize) {
701+
return new MachineTypeListOption(ComputeRpc.Option.MAX_RESULTS, pageSize);
702702
}
703703

704704
/**
@@ -742,8 +742,8 @@ public static MachineTypeAggregatedListOption filter(MachineTypeFilter filter) {
742742
/**
743743
* Returns an option to specify the maximum number of machine types to be returned.
744744
*/
745-
public static MachineTypeAggregatedListOption maxResults(long maxResults) {
746-
return new MachineTypeAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, maxResults);
745+
public static MachineTypeAggregatedListOption pageSize(long pageSize) {
746+
return new MachineTypeAggregatedListOption(ComputeRpc.Option.MAX_RESULTS, pageSize);
747747
}
748748

749749
/**
@@ -797,8 +797,8 @@ public static RegionListOption filter(RegionFilter filter) {
797797
/**
798798
* Returns an option to specify the maximum number of regions to be returned.
799799
*/
800-
public static RegionListOption maxResults(long maxResults) {
801-
return new RegionListOption(ComputeRpc.Option.MAX_RESULTS, maxResults);
800+
public static RegionListOption pageSize(long pageSize) {
801+
return new RegionListOption(ComputeRpc.Option.MAX_RESULTS, pageSize);
802802
}
803803

804804
/**
@@ -864,8 +864,8 @@ public static ZoneListOption filter(ZoneFilter filter) {
864864
/**
865865
* Returns an option to specify the maximum number of zones to be returned.
866866
*/
867-
public static ZoneListOption maxResults(long maxResults) {
868-
return new ZoneListOption(ComputeRpc.Option.MAX_RESULTS, maxResults);
867+
public static ZoneListOption pageSize(long pageSize) {
868+
return new ZoneListOption(ComputeRpc.Option.MAX_RESULTS, pageSize);
869869
}
870870

871871
/**
@@ -953,8 +953,8 @@ public static OperationListOption filter(OperationFilter filter) {
953953
/**
954954
* Returns an option to specify the maximum number of operations to be returned.
955955
*/
956-
public static OperationListOption maxResults(long maxResults) {
957-
return new OperationListOption(ComputeRpc.Option.MAX_RESULTS, maxResults);
956+
public static OperationListOption pageSize(long pageSize) {
957+
return new OperationListOption(ComputeRpc.Option.MAX_RESULTS, pageSize);
958958
}
959959

960960
/**

gcloud-java-compute/src/main/java/com/google/gcloud/compute/Operation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* Google Compute Engine operations. Operation identity can be obtained via {@link #operationId()}.
4141
* {@link #operationId()} returns {@link GlobalOperationId} for global operations,
4242
* {@link RegionOperationId} for region operations, and {@link ZoneOperationId} for zone operations.
43-
* To get an {@code Operation} object with the most recent information use
43+
* To get an {@code Operation} object with the most recent information, use
4444
* {@link #reload(Compute.OperationOption...)}.
4545
*/
4646
public final class Operation implements Serializable {

0 commit comments

Comments
 (0)