Skip to content

Commit 4c17b4e

Browse files
committed
---
yaml --- r: 1127 b: refs/heads/master c: 104bf41 h: refs/heads/master i: 1125: 7e611a9 1123: fcded47 1119: b8e8a42 v: v3
1 parent 92c6c2e commit 4c17b4e

7 files changed

Lines changed: 24 additions & 24 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
refs/heads/master: 6753c541b99e947d0af13b6e4d88ce65cd65a4c7
2+
refs/heads/master: 104bf41e1c6ff76f36816d2e9b8b75cfe5db8f5c
33
refs/heads/travis: 0fa997e2fc9c6b61b2d91e6d163655aae67d44b6
44
refs/heads/gh-pages: 5a10432ecc75f29812e33a8236c900379509fe99

trunk/gcloud-java-core/src/main/java/com/google/gcloud/BasePage.java renamed to trunk/gcloud-java-core/src/main/java/com/google/gcloud/PageImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* Base implementation for Google Cloud paginated results.
2525
*/
26-
public class BasePage<T> implements Page<T>, Serializable {
26+
public class PageImpl<T> implements Page<T>, Serializable {
2727

2828
private static final long serialVersionUID = 3914827379823557934L;
2929

@@ -36,10 +36,10 @@ public interface NextPageFetcher<T> extends Serializable {
3636
}
3737

3838
/**
39-
* Creates a {@code BasePage} object. In order for the object to be serializable the {@code
39+
* Creates a {@code PageImpl} object. In order for the object to be serializable the {@code
4040
* results} parameter must be serializable.
4141
*/
42-
public BasePage(NextPageFetcher<T> pageFetcher, String cursor, Iterable<T> results) {
42+
public PageImpl(NextPageFetcher<T> pageFetcher, String cursor, Iterable<T> results) {
4343
this.pageFetcher = pageFetcher;
4444
this.cursor = cursor;
4545
this.results = results;
@@ -70,10 +70,10 @@ public int hashCode() {
7070

7171
@Override
7272
public boolean equals(Object obj) {
73-
if (!(obj instanceof BasePage)) {
73+
if (!(obj instanceof PageImpl)) {
7474
return false;
7575
}
76-
BasePage<?> other = (BasePage<?>) obj;
76+
PageImpl<?> other = (PageImpl<?>) obj;
7777
return Objects.equals(cursor, other.cursor)
7878
&& Objects.equals(results, other.results);
7979
}

trunk/gcloud-java-core/src/test/java/com/google/gcloud/BasePageTest.java renamed to trunk/gcloud-java-core/src/test/java/com/google/gcloud/PageImplTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424

2525
import java.util.Collections;
2626

27-
public class BasePageTest {
27+
public class PageImplTest {
2828

2929
@Test
3030
public void testPage() throws Exception {
3131
ImmutableList<String> values = ImmutableList.of("1", "2");
32-
final BasePage<String> nextResult =
33-
new BasePage<>(null, "c", Collections.<String>emptyList());
34-
BasePage.NextPageFetcher<String> fetcher = new BasePage.NextPageFetcher<String>() {
32+
final PageImpl<String> nextResult =
33+
new PageImpl<>(null, "c", Collections.<String>emptyList());
34+
PageImpl.NextPageFetcher<String> fetcher = new PageImpl.NextPageFetcher<String>() {
3535

3636
@Override
37-
public BasePage<String> nextPage() {
37+
public PageImpl<String> nextPage() {
3838
return nextResult;
3939
}
4040
};
41-
BasePage<String> result = new BasePage<>(fetcher, "c", values);
41+
PageImpl<String> result = new PageImpl<>(fetcher, "c", values);
4242
assertEquals(nextResult, result.nextPage());
4343
assertEquals("c", result.nextPageCursor());
4444
assertEquals(values, ImmutableList.copyOf(result.values().iterator()));

trunk/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Bucket.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.google.common.base.Function;
2323
import com.google.common.base.MoreObjects;
2424
import com.google.common.collect.Iterators;
25-
import com.google.gcloud.BasePage;
25+
import com.google.gcloud.PageImpl;
2626
import com.google.gcloud.Page;
2727
import com.google.gcloud.storage.Storage.BlobSourceOption;
2828
import com.google.gcloud.storage.Storage.BlobTargetOption;
@@ -54,7 +54,7 @@ public final class Bucket {
5454
private final Storage storage;
5555
private final BucketInfo info;
5656

57-
private static class BlobPageFetcher implements BasePage.NextPageFetcher<Blob> {
57+
private static class BlobPageFetcher implements PageImpl.NextPageFetcher<Blob> {
5858

5959
private static final long serialVersionUID = 3221100177471323801L;
6060

@@ -69,7 +69,7 @@ private static class BlobPageFetcher implements BasePage.NextPageFetcher<Blob> {
6969
@Override
7070
public Page<Blob> nextPage() {
7171
Page<BlobInfo> nextInfoPage = infoPage.nextPage();
72-
return new BasePage<Blob>(new BlobPageFetcher(options, nextInfoPage),
72+
return new PageImpl<Blob>(new BlobPageFetcher(options, nextInfoPage),
7373
nextInfoPage.nextPageCursor(), new LazyBlobIterable(options, nextInfoPage.values()));
7474
}
7575
}
@@ -210,7 +210,7 @@ public boolean delete(BucketSourceOption... options) {
210210
public Page<Blob> list(Storage.BlobListOption... options) {
211211
Page<BlobInfo> infoPage = storage.list(info.name(), options);
212212
StorageOptions storageOptions = storage.options();
213-
return new BasePage<Blob>(new BlobPageFetcher(storageOptions, infoPage),
213+
return new PageImpl<Blob>(new BlobPageFetcher(storageOptions, infoPage),
214214
infoPage.nextPageCursor(), new LazyBlobIterable(storageOptions, infoPage.values()));
215215
}
216216

trunk/gcloud-java-storage/src/main/java/com/google/gcloud/storage/StorageImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import com.google.common.io.BaseEncoding;
4545
import com.google.common.primitives.Ints;
4646
import com.google.gcloud.AuthCredentials.ServiceAccountAuthCredentials;
47-
import com.google.gcloud.BasePage;
47+
import com.google.gcloud.PageImpl;
4848
import com.google.gcloud.BaseService;
4949
import com.google.gcloud.ExceptionHandler;
5050
import com.google.gcloud.ExceptionHandler.Interceptor;
@@ -226,7 +226,7 @@ public BlobInfo get(BlobId blob) {
226226
}
227227

228228
private abstract static class BasePageFetcher<T extends Serializable>
229-
implements BasePage.NextPageFetcher<T> {
229+
implements PageImpl.NextPageFetcher<T> {
230230

231231
private static final long serialVersionUID = 8236329004030295223L;
232232
protected final Map<StorageRpc.Option, ?> requestOptions;
@@ -304,7 +304,7 @@ public BucketInfo apply(com.google.api.services.storage.model.Bucket bucketPb) {
304304
return BucketInfo.fromPb(bucketPb);
305305
}
306306
});
307-
return new BasePage<>(new BucketPageFetcher(serviceOptions, cursor, optionsMap), cursor,
307+
return new PageImpl<>(new BucketPageFetcher(serviceOptions, cursor, optionsMap), cursor,
308308
buckets);
309309
} catch (RetryHelperException e) {
310310
throw StorageException.translateAndThrow(e);
@@ -335,7 +335,7 @@ public BlobInfo apply(StorageObject storageObject) {
335335
return BlobInfo.fromPb(storageObject);
336336
}
337337
});
338-
return new BasePage<>(new BlobPageFetcher(bucket, serviceOptions, cursor, optionsMap),
338+
return new PageImpl<>(new BlobPageFetcher(bucket, serviceOptions, cursor, optionsMap),
339339
cursor,
340340
blobs);
341341
} catch (RetryHelperException e) {

trunk/gcloud-java-storage/src/test/java/com/google/gcloud/storage/BucketTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import static org.junit.Assert.assertTrue;
2828

2929
import com.google.common.collect.ImmutableList;
30-
import com.google.gcloud.BasePage;
30+
import com.google.gcloud.PageImpl;
3131
import com.google.gcloud.Page;
3232
import com.google.gcloud.storage.BatchResponse.Result;
3333

@@ -117,7 +117,7 @@ public void testDelete() throws Exception {
117117
@Test
118118
public void testList() throws Exception {
119119
StorageOptions storageOptions = createStrictMock(StorageOptions.class);
120-
BasePage<BlobInfo> blobInfoPage = new BasePage<>(null, "c", BLOB_INFO_RESULTS);
120+
PageImpl<BlobInfo> blobInfoPage = new PageImpl<>(null, "c", BLOB_INFO_RESULTS);
121121
expect(storage.list(BUCKET_INFO.name())).andReturn(blobInfoPage);
122122
expect(storage.options()).andReturn(storageOptions);
123123
expect(storageOptions.service()).andReturn(storage);

trunk/gcloud-java-storage/src/test/java/com/google/gcloud/storage/SerializationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import com.google.common.collect.ImmutableMap;
2323
import com.google.gcloud.AuthCredentials;
24-
import com.google.gcloud.BasePage;
24+
import com.google.gcloud.PageImpl;
2525
import com.google.gcloud.RestorableState;
2626
import com.google.gcloud.RetryParams;
2727
import com.google.gcloud.spi.StorageRpc;
@@ -55,7 +55,7 @@ public class SerializationTest {
5555
Collections.singletonList(BatchResponse.Result.of(true)),
5656
Collections.<BatchResponse.Result<BlobInfo>>emptyList(),
5757
Collections.<BatchResponse.Result<BlobInfo>>emptyList());
58-
private static final BasePage<BlobInfo> PAGE_RESULT = new BasePage<>(
58+
private static final PageImpl<BlobInfo> PAGE_RESULT = new PageImpl<>(
5959
null, "c", Collections.singletonList(BlobInfo.builder("b", "n").build()));
6060
private static final Storage.BlobListOption BLOB_LIST_OPTIONS =
6161
Storage.BlobListOption.maxResults(100);

0 commit comments

Comments
 (0)