Skip to content

Commit 6edd748

Browse files
committed
Make checkstyle happy
1 parent 2808d95 commit 6edd748

File tree

13 files changed

+95
-87
lines changed

13 files changed

+95
-87
lines changed

gcloud-java-storage/src/main/java/com/google/gcloud/storage/Acl.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ protected String value() {
7373
}
7474

7575
@Override
76-
public boolean equals(Object o) {
77-
if (this == o) {
76+
public boolean equals(Object obj) {
77+
if (this == obj) {
7878
return true;
7979
}
80-
if (o == null || getClass() != o.getClass()) {
80+
if (obj == null || getClass() != obj.getClass()) {
8181
return false;
8282
}
83-
Entity entity = (Entity) o;
83+
Entity entity = (Entity) obj;
8484
return Objects.equals(type, entity.type) && Objects.equals(value, entity.value);
8585
}
8686

@@ -226,7 +226,7 @@ public static final class Project extends Entity {
226226

227227
private static final long serialVersionUID = 7933776866530023027L;
228228

229-
private final ProjectRole pRole;
229+
private final ProjectRole projectRole;
230230
private final String projectId;
231231

232232
public enum ProjectRole {
@@ -236,20 +236,20 @@ public enum ProjectRole {
236236
/**
237237
* Creates a project entity.
238238
*
239-
* @param pRole a role in the project, used to select project's teams
239+
* @param projectRole a role in the project, used to select project's teams
240240
* @param projectId id of the project
241241
*/
242-
public Project(ProjectRole pRole, String projectId) {
243-
super(Type.PROJECT, pRole.name().toLowerCase() + "-" + projectId);
244-
this.pRole = pRole;
242+
public Project(ProjectRole projectRole, String projectId) {
243+
super(Type.PROJECT, projectRole.name().toLowerCase() + "-" + projectId);
244+
this.projectRole = projectRole;
245245
this.projectId = projectId;
246246
}
247247

248248
/**
249249
* Returns the role in the project for this entity.
250250
*/
251251
public ProjectRole projectRole() {
252-
return pRole;
252+
return projectRole;
253253
}
254254

255255
/**

gcloud-java-storage/src/main/java/com/google/gcloud/storage/BatchResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static <T extends Serializable> Result<T> empty() {
113113
}
114114
}
115115

116-
public BatchResponse(List<Result<Boolean>> deleteResult, List<Result<BlobInfo>> updateResult,
116+
BatchResponse(List<Result<Boolean>> deleteResult, List<Result<BlobInfo>> updateResult,
117117
List<Result<BlobInfo>> getResult) {
118118
this.deleteResult = ImmutableList.copyOf(deleteResult);
119119
this.updateResult = ImmutableList.copyOf(updateResult);

gcloud-java-storage/src/main/java/com/google/gcloud/storage/Blob.java

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
/**
4040
* A Google cloud storage object.
4141
*
42-
* <p>
43-
* Objects of this class are immutable. Operations that modify the blob like {@link #update} and
42+
* <p>Objects of this class are immutable. Operations that modify the blob like {@link #update} and
4443
* {@link #copyTo} return a new object. To get a {@code Blob} object with the most recent
4544
* information use {@link #reload}.
4645
* </p>
@@ -239,13 +238,13 @@ public Blob reload(BlobSourceOption... options) {
239238
* made on the metadata generation of the current blob. If you want to update the information only
240239
* if the current blob metadata are at their latest version use the {@code metagenerationMatch}
241240
* option: {@code blob.update(newInfo, BlobTargetOption.metagenerationMatch())}.
242-
* <p>
243-
* Original metadata are merged with metadata in the provided {@code blobInfo}. To replace
241+
*
242+
* <p>Original metadata are merged with metadata in the provided {@code blobInfo}. To replace
244243
* metadata instead you first have to unset them. Unsetting metadata can be done by setting the
245244
* provided {@code blobInfo}'s metadata to {@code null}.
246245
* </p>
247-
* <p>
248-
* Example usage of replacing blob's metadata:
246+
*
247+
* <p>Example usage of replacing blob's metadata:
249248
* <pre> {@code blob.update(blob.info().toBuilder().metadata(null).build());}
250249
* {@code blob.update(blob.info().toBuilder().metadata(newMetadata).build());}
251250
* </pre>
@@ -261,6 +260,17 @@ public Blob update(BlobInfo blobInfo, BlobTargetOption... options) {
261260
return new Blob(storage, storage.update(blobInfo, options));
262261
}
263262

263+
/**
264+
* Deletes this blob.
265+
*
266+
* @param options blob delete options
267+
* @return {@code true} if blob was deleted, {@code false} if it was not found
268+
* @throws StorageException upon failure
269+
*/
270+
public boolean delete(BlobSourceOption... options) {
271+
return storage.delete(info.blobId(), toSourceOptions(info, options));
272+
}
273+
264274
/**
265275
* Sends a copy request for the current blob to the target blob. Possibly also some of the
266276
* metadata are copied (e.g. content-type).
@@ -277,17 +287,6 @@ public CopyWriter copyTo(BlobId targetBlob, BlobSourceOption... options) {
277287
return storage.copy(copyRequest);
278288
}
279289

280-
/**
281-
* Deletes this blob.
282-
*
283-
* @param options blob delete options
284-
* @return {@code true} if blob was deleted, {@code false} if it was not found
285-
* @throws StorageException upon failure
286-
*/
287-
public boolean delete(BlobSourceOption... options) {
288-
return storage.delete(info.blobId(), toSourceOptions(info, options));
289-
}
290-
291290
/**
292291
* Sends a copy request for the current blob to the target bucket, preserving its name. Possibly
293292
* copying also some of the metadata (e.g. content-type).
@@ -381,8 +380,8 @@ public static List<Blob> get(final Storage storage, BlobId... blobs) {
381380
return Collections.unmodifiableList(Lists.transform(storage.get(blobs),
382381
new Function<BlobInfo, Blob>() {
383382
@Override
384-
public Blob apply(BlobInfo f) {
385-
return f != null ? new Blob(storage, f) : null;
383+
public Blob apply(BlobInfo blobInfo) {
384+
return blobInfo != null ? new Blob(storage, blobInfo) : null;
386385
}
387386
}));
388387
}
@@ -410,8 +409,8 @@ public static List<Blob> update(final Storage storage, BlobInfo... infos) {
410409
return Collections.unmodifiableList(Lists.transform(storage.update(infos),
411410
new Function<BlobInfo, Blob>() {
412411
@Override
413-
public Blob apply(BlobInfo f) {
414-
return f != null ? new Blob(storage, f) : null;
412+
public Blob apply(BlobInfo blobInfo) {
413+
return blobInfo != null ? new Blob(storage, blobInfo) : null;
415414
}
416415
}));
417416
}

gcloud-java-storage/src/main/java/com/google/gcloud/storage/BlobReadChannel.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626
/**
2727
* A channel for reading data from a Google Cloud Storage object.
2828
*
29-
* Implementations of this class may buffer data internally to reduce remote calls. This interface
30-
* implements {@link Restorable} to allow saving the reader's state to continue reading afterwards.
29+
* <p>Implementations of this class may buffer data internally to reduce remote calls. This
30+
* interface implements {@link Restorable} to allow saving the reader's state to continue reading
31+
* afterwards.
32+
* </p>
3133
*/
3234
public interface BlobReadChannel extends ReadableByteChannel, Closeable,
3335
Restorable<BlobReadChannel> {

gcloud-java-storage/src/main/java/com/google/gcloud/storage/BlobWriteChannel.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
/**
2626
* A channel for writing data to a Google Cloud Storage object.
2727
*
28-
* Implementations of this class may further buffer data internally to reduce remote calls. Written
29-
* data will only be visible after calling {@link #close()}. This interface implements
28+
* <p>Implementations of this class may further buffer data internally to reduce remote calls.
29+
* Written data will only be visible after calling {@link #close()}. This interface implements
3030
* {@link Restorable} to allow saving the writer's state to continue writing afterwards.
31+
* </p>
3132
*/
3233
public interface BlobWriteChannel extends WritableByteChannel, Closeable,
3334
Restorable<BlobWriteChannel> {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
/**
4747
* A Google cloud storage bucket.
4848
*
49-
* <p>
50-
* Objects of this class are immutable. Operations that modify the bucket like {@link #update}
49+
* <p>Objects of this class are immutable. Operations that modify the bucket like {@link #update}
5150
* return a new object. To get a {@code Bucket} object with the most recent information use
5251
* {@link #reload}.
5352
* </p>

gcloud-java-storage/src/main/java/com/google/gcloud/storage/CopyWriter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public class CopyWriter implements Restorable<CopyWriter> {
5555
/**
5656
* Returns the updated information for the written blob. Calling this method when {@code isDone()}
5757
* is {@code false} will block until all pending chunks are copied.
58-
* <p>
59-
* This method has the same effect of doing:
58+
*
59+
* <p>This method has the same effect of doing:
6060
* <pre> {@code while (!copyWriter.isDone()) {
6161
* copyWriter.copyChunk();
6262
* }}

gcloud-java-storage/src/main/java/com/google/gcloud/storage/Option.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.util.Objects;
2626

2727
/**
28-
* Base class for Storage operation option
28+
* Base class for Storage operation option.
2929
*/
3030
class Option implements Serializable {
3131

gcloud-java-storage/src/main/java/com/google/gcloud/storage/Storage.java

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,14 @@ public static BlobSourceOption generationMatch() {
488488
return new BlobSourceOption(StorageRpc.Option.IF_GENERATION_MATCH, null);
489489
}
490490

491+
/**
492+
* Returns an option for blob's data generation match. If this option is used the request will
493+
* fail if blob's generation does not match the provided value.
494+
*/
495+
public static BlobSourceOption generationMatch(long generation) {
496+
return new BlobSourceOption(StorageRpc.Option.IF_GENERATION_MATCH, generation);
497+
}
498+
491499
/**
492500
* Returns an option for blob's data generation mismatch. If this option is used the request
493501
* will fail if blob's generation matches. The generation value to compare with the actual
@@ -499,10 +507,6 @@ public static BlobSourceOption generationNotMatch() {
499507
return new BlobSourceOption(StorageRpc.Option.IF_GENERATION_NOT_MATCH, null);
500508
}
501509

502-
public static BlobSourceOption generationMatch(long generation) {
503-
return new BlobSourceOption(StorageRpc.Option.IF_GENERATION_MATCH, generation);
504-
}
505-
506510
/**
507511
* Returns an option for blob's data generation mismatch. If this option is used the request
508512
* will fail if blob's generation matches the provided value.
@@ -554,6 +558,14 @@ public static BlobGetOption generationMatch() {
554558
return new BlobGetOption(StorageRpc.Option.IF_GENERATION_MATCH, (Long) null);
555559
}
556560

561+
/**
562+
* Returns an option for blob's data generation match. If this option is used the request will
563+
* fail if blob's generation does not match the provided value.
564+
*/
565+
public static BlobGetOption generationMatch(long generation) {
566+
return new BlobGetOption(StorageRpc.Option.IF_GENERATION_MATCH, generation);
567+
}
568+
557569
/**
558570
* Returns an option for blob's data generation mismatch. If this option is used the request
559571
* will fail if blob's generation matches. The generation value to compare with the actual
@@ -565,10 +577,6 @@ public static BlobGetOption generationNotMatch() {
565577
return new BlobGetOption(StorageRpc.Option.IF_GENERATION_NOT_MATCH, (Long) null);
566578
}
567579

568-
public static BlobGetOption generationMatch(long generation) {
569-
return new BlobGetOption(StorageRpc.Option.IF_GENERATION_MATCH, generation);
570-
}
571-
572580
/**
573581
* Returns an option for blob's data generation mismatch. If this option is used the request
574582
* will fail if blob's generation matches the provided value.
@@ -1287,8 +1295,8 @@ private static void checkContentType(BlobInfo blobInfo) throws IllegalArgumentEx
12871295
* Update blob information. Original metadata are merged with metadata in the provided
12881296
* {@code blobInfo}. To replace metadata instead you first have to unset them. Unsetting metadata
12891297
* can be done by setting the provided {@code blobInfo}'s metadata to {@code null}.
1290-
* <p>
1291-
* Example usage of replacing blob's metadata:
1298+
*
1299+
* <p>Example usage of replacing blob's metadata:
12921300
* <pre> {@code service.update(BlobInfo.builder("bucket", "name").metadata(null).build());}
12931301
* {@code service.update(BlobInfo.builder("bucket", "name").metadata(newMetadata).build());}
12941302
* </pre>
@@ -1302,8 +1310,8 @@ private static void checkContentType(BlobInfo blobInfo) throws IllegalArgumentEx
13021310
* Update blob information. Original metadata are merged with metadata in the provided
13031311
* {@code blobInfo}. To replace metadata instead you first have to unset them. Unsetting metadata
13041312
* can be done by setting the provided {@code blobInfo}'s metadata to {@code null}.
1305-
* <p>
1306-
* Example usage of replacing blob's metadata:
1313+
*
1314+
* <p>Example usage of replacing blob's metadata:
13071315
* <pre> {@code service.update(BlobInfo.builder("bucket", "name").metadata(null).build());}
13081316
* {@code service.update(BlobInfo.builder("bucket", "name").metadata(newMetadata).build());}
13091317
* </pre>
@@ -1360,8 +1368,8 @@ private static void checkContentType(BlobInfo blobInfo) throws IllegalArgumentEx
13601368
* returns, regardless of the {@link CopyRequest#megabytesCopiedPerChunk} parameter.
13611369
* If source and destination have different location or storage class {@link CopyWriter#result()}
13621370
* might issue multiple RPC calls depending on blob's size.
1363-
* <p>
1364-
* Example usage of copy:
1371+
*
1372+
* <p>Example usage of copy:
13651373
* <pre> {@code BlobInfo blob = service.copy(copyRequest).result();}
13661374
* </pre>
13671375
* To explicitly issue chunk copy requests use {@link CopyWriter#copyChunk()} instead:
@@ -1449,8 +1457,8 @@ private static void checkContentType(BlobInfo blobInfo) throws IllegalArgumentEx
14491457
* is only valid within a certain time period.
14501458
* This is particularly useful if you don't want publicly
14511459
* accessible blobs, but don't want to require users to explicitly log in.
1452-
* <p>
1453-
* Example usage of creating a signed URL that is valid for 2 weeks:
1460+
*
1461+
* <p>Example usage of creating a signed URL that is valid for 2 weeks:
14541462
* <pre> {@code
14551463
* service.signUrl(BlobInfo.builder("bucket", "name").build(), 14, TimeUnit.DAYS);
14561464
* }</pre>

0 commit comments

Comments
 (0)