Skip to content

Commit 818e4e8

Browse files
author
Ben Creech
committed
Supress unchecked conversion warnings
1 parent 85b3ebd commit 818e4e8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

‎google-cloud-logging/src/main/java/com/google/cloud/logging/Payload.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public static StringPayload of(String data) {
6868
return new StringPayload(data);
6969
}
7070

71+
@SuppressWarnings("unchecked")
7172
static StringPayload fromPb(com.google.logging.v2.LogEntry entryPb) {
7273
return StringPayload.of(entryPb.getTextPayload());
7374
}
@@ -124,6 +125,7 @@ public static JsonPayload of(Struct data) {
124125
return new JsonPayload(data);
125126
}
126127

128+
@SuppressWarnings("unchecked")
127129
static JsonPayload fromPb(com.google.logging.v2.LogEntry entryPb) {
128130
return JsonPayload.of(entryPb.getJsonPayload());
129131
}
@@ -148,6 +150,7 @@ public static ProtoPayload of(Any data) {
148150
return new ProtoPayload(data);
149151
}
150152

153+
@SuppressWarnings("unchecked")
151154
static ProtoPayload fromPb(com.google.logging.v2.LogEntry entryPb) {
152155
return ProtoPayload.of(entryPb.getProtoPayload());
153156
}

‎google-cloud-logging/src/main/java/com/google/cloud/logging/SinkInfo.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public static BucketDestination of(String bucket) {
127127
return new BucketDestination(bucket);
128128
}
129129

130+
@SuppressWarnings("unchecked")
130131
static BucketDestination fromPb(String destinationPb) {
131132
Matcher matcher = PATTERN.matcher(destinationPb);
132133
if (!matcher.matches()) {
@@ -219,6 +220,7 @@ static boolean matchesDestination(String destinationPb) {
219220
return PATTERN.matcher(destinationPb).matches();
220221
}
221222

223+
@SuppressWarnings("unchecked")
222224
static DatasetDestination fromPb(String destinationPb) {
223225
Matcher matcher = PATTERN.matcher(destinationPb);
224226
if (!matcher.matches()) {
@@ -319,6 +321,7 @@ static boolean matchesDestination(String destinationPb) {
319321
return PATTERN.matcher(destinationPb).matches();
320322
}
321323

324+
@SuppressWarnings("unchecked")
322325
static LoggingBucketDestination fromPb(String destinationPb) {
323326
Matcher matcher = PATTERN.matcher(destinationPb);
324327
if (!matcher.matches()) {
@@ -411,6 +414,7 @@ static boolean matchesDestination(String destinationPb) {
411414
return PATTERN.matcher(destinationPb).matches();
412415
}
413416

417+
@SuppressWarnings("unchecked")
414418
static TopicDestination fromPb(String destinationPb) {
415419
Matcher matcher = PATTERN.matcher(destinationPb);
416420
if (!matcher.matches()) {

0 commit comments

Comments
 (0)