• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto
18 
19 package io.grafeas.v1beta1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * An entity that can have metadata. For example, a Docker image.
26  * </pre>
27  *
28  * Protobuf type {@code grafeas.v1beta1.Resource}
29  */
30 public final class Resource extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:grafeas.v1beta1.Resource)
33     ResourceOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use Resource.newBuilder() to construct.
Resource(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private Resource(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
Resource()40   private Resource() {
41     name_ = "";
42     uri_ = "";
43   }
44 
45   @java.lang.Override
46   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)47   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
48     return new Resource();
49   }
50 
51   @java.lang.Override
getUnknownFields()52   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
53     return this.unknownFields;
54   }
55 
Resource( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)56   private Resource(
57       com.google.protobuf.CodedInputStream input,
58       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
59       throws com.google.protobuf.InvalidProtocolBufferException {
60     this();
61     if (extensionRegistry == null) {
62       throw new java.lang.NullPointerException();
63     }
64     com.google.protobuf.UnknownFieldSet.Builder unknownFields =
65         com.google.protobuf.UnknownFieldSet.newBuilder();
66     try {
67       boolean done = false;
68       while (!done) {
69         int tag = input.readTag();
70         switch (tag) {
71           case 0:
72             done = true;
73             break;
74           case 10:
75             {
76               java.lang.String s = input.readStringRequireUtf8();
77 
78               name_ = s;
79               break;
80             }
81           case 18:
82             {
83               java.lang.String s = input.readStringRequireUtf8();
84 
85               uri_ = s;
86               break;
87             }
88           case 26:
89             {
90               io.grafeas.v1beta1.provenance.Hash.Builder subBuilder = null;
91               if (contentHash_ != null) {
92                 subBuilder = contentHash_.toBuilder();
93               }
94               contentHash_ =
95                   input.readMessage(io.grafeas.v1beta1.provenance.Hash.parser(), extensionRegistry);
96               if (subBuilder != null) {
97                 subBuilder.mergeFrom(contentHash_);
98                 contentHash_ = subBuilder.buildPartial();
99               }
100 
101               break;
102             }
103           default:
104             {
105               if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
106                 done = true;
107               }
108               break;
109             }
110         }
111       }
112     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
113       throw e.setUnfinishedMessage(this);
114     } catch (java.io.IOException e) {
115       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
116     } finally {
117       this.unknownFields = unknownFields.build();
118       makeExtensionsImmutable();
119     }
120   }
121 
getDescriptor()122   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
123     return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Resource_descriptor;
124   }
125 
126   @java.lang.Override
127   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()128       internalGetFieldAccessorTable() {
129     return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Resource_fieldAccessorTable
130         .ensureFieldAccessorsInitialized(
131             io.grafeas.v1beta1.Resource.class, io.grafeas.v1beta1.Resource.Builder.class);
132   }
133 
134   public static final int NAME_FIELD_NUMBER = 1;
135   private volatile java.lang.Object name_;
136   /**
137    *
138    *
139    * <pre>
140    * The name of the resource. For example, the name of a Docker image -
141    * "Debian".
142    * </pre>
143    *
144    * <code>string name = 1;</code>
145    *
146    * @return The name.
147    */
148   @java.lang.Override
getName()149   public java.lang.String getName() {
150     java.lang.Object ref = name_;
151     if (ref instanceof java.lang.String) {
152       return (java.lang.String) ref;
153     } else {
154       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
155       java.lang.String s = bs.toStringUtf8();
156       name_ = s;
157       return s;
158     }
159   }
160   /**
161    *
162    *
163    * <pre>
164    * The name of the resource. For example, the name of a Docker image -
165    * "Debian".
166    * </pre>
167    *
168    * <code>string name = 1;</code>
169    *
170    * @return The bytes for name.
171    */
172   @java.lang.Override
getNameBytes()173   public com.google.protobuf.ByteString getNameBytes() {
174     java.lang.Object ref = name_;
175     if (ref instanceof java.lang.String) {
176       com.google.protobuf.ByteString b =
177           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
178       name_ = b;
179       return b;
180     } else {
181       return (com.google.protobuf.ByteString) ref;
182     }
183   }
184 
185   public static final int URI_FIELD_NUMBER = 2;
186   private volatile java.lang.Object uri_;
187   /**
188    *
189    *
190    * <pre>
191    * Required. The unique URI of the resource. For example,
192    * `https://gcr.io/project/image&#64;sha256:foo` for a Docker image.
193    * </pre>
194    *
195    * <code>string uri = 2;</code>
196    *
197    * @return The uri.
198    */
199   @java.lang.Override
getUri()200   public java.lang.String getUri() {
201     java.lang.Object ref = uri_;
202     if (ref instanceof java.lang.String) {
203       return (java.lang.String) ref;
204     } else {
205       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
206       java.lang.String s = bs.toStringUtf8();
207       uri_ = s;
208       return s;
209     }
210   }
211   /**
212    *
213    *
214    * <pre>
215    * Required. The unique URI of the resource. For example,
216    * `https://gcr.io/project/image&#64;sha256:foo` for a Docker image.
217    * </pre>
218    *
219    * <code>string uri = 2;</code>
220    *
221    * @return The bytes for uri.
222    */
223   @java.lang.Override
getUriBytes()224   public com.google.protobuf.ByteString getUriBytes() {
225     java.lang.Object ref = uri_;
226     if (ref instanceof java.lang.String) {
227       com.google.protobuf.ByteString b =
228           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
229       uri_ = b;
230       return b;
231     } else {
232       return (com.google.protobuf.ByteString) ref;
233     }
234   }
235 
236   public static final int CONTENT_HASH_FIELD_NUMBER = 3;
237   private io.grafeas.v1beta1.provenance.Hash contentHash_;
238   /**
239    *
240    *
241    * <pre>
242    * The hash of the resource content. For example, the Docker digest.
243    * </pre>
244    *
245    * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
246    *
247    * @return Whether the contentHash field is set.
248    */
249   @java.lang.Override
hasContentHash()250   public boolean hasContentHash() {
251     return contentHash_ != null;
252   }
253   /**
254    *
255    *
256    * <pre>
257    * The hash of the resource content. For example, the Docker digest.
258    * </pre>
259    *
260    * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
261    *
262    * @return The contentHash.
263    */
264   @java.lang.Override
getContentHash()265   public io.grafeas.v1beta1.provenance.Hash getContentHash() {
266     return contentHash_ == null
267         ? io.grafeas.v1beta1.provenance.Hash.getDefaultInstance()
268         : contentHash_;
269   }
270   /**
271    *
272    *
273    * <pre>
274    * The hash of the resource content. For example, the Docker digest.
275    * </pre>
276    *
277    * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
278    */
279   @java.lang.Override
getContentHashOrBuilder()280   public io.grafeas.v1beta1.provenance.HashOrBuilder getContentHashOrBuilder() {
281     return getContentHash();
282   }
283 
284   private byte memoizedIsInitialized = -1;
285 
286   @java.lang.Override
isInitialized()287   public final boolean isInitialized() {
288     byte isInitialized = memoizedIsInitialized;
289     if (isInitialized == 1) return true;
290     if (isInitialized == 0) return false;
291 
292     memoizedIsInitialized = 1;
293     return true;
294   }
295 
296   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)297   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
298     if (!getNameBytes().isEmpty()) {
299       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
300     }
301     if (!getUriBytes().isEmpty()) {
302       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uri_);
303     }
304     if (contentHash_ != null) {
305       output.writeMessage(3, getContentHash());
306     }
307     unknownFields.writeTo(output);
308   }
309 
310   @java.lang.Override
getSerializedSize()311   public int getSerializedSize() {
312     int size = memoizedSize;
313     if (size != -1) return size;
314 
315     size = 0;
316     if (!getNameBytes().isEmpty()) {
317       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
318     }
319     if (!getUriBytes().isEmpty()) {
320       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uri_);
321     }
322     if (contentHash_ != null) {
323       size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getContentHash());
324     }
325     size += unknownFields.getSerializedSize();
326     memoizedSize = size;
327     return size;
328   }
329 
330   @java.lang.Override
equals(final java.lang.Object obj)331   public boolean equals(final java.lang.Object obj) {
332     if (obj == this) {
333       return true;
334     }
335     if (!(obj instanceof io.grafeas.v1beta1.Resource)) {
336       return super.equals(obj);
337     }
338     io.grafeas.v1beta1.Resource other = (io.grafeas.v1beta1.Resource) obj;
339 
340     if (!getName().equals(other.getName())) return false;
341     if (!getUri().equals(other.getUri())) return false;
342     if (hasContentHash() != other.hasContentHash()) return false;
343     if (hasContentHash()) {
344       if (!getContentHash().equals(other.getContentHash())) return false;
345     }
346     if (!unknownFields.equals(other.unknownFields)) return false;
347     return true;
348   }
349 
350   @java.lang.Override
hashCode()351   public int hashCode() {
352     if (memoizedHashCode != 0) {
353       return memoizedHashCode;
354     }
355     int hash = 41;
356     hash = (19 * hash) + getDescriptor().hashCode();
357     hash = (37 * hash) + NAME_FIELD_NUMBER;
358     hash = (53 * hash) + getName().hashCode();
359     hash = (37 * hash) + URI_FIELD_NUMBER;
360     hash = (53 * hash) + getUri().hashCode();
361     if (hasContentHash()) {
362       hash = (37 * hash) + CONTENT_HASH_FIELD_NUMBER;
363       hash = (53 * hash) + getContentHash().hashCode();
364     }
365     hash = (29 * hash) + unknownFields.hashCode();
366     memoizedHashCode = hash;
367     return hash;
368   }
369 
parseFrom(java.nio.ByteBuffer data)370   public static io.grafeas.v1beta1.Resource parseFrom(java.nio.ByteBuffer data)
371       throws com.google.protobuf.InvalidProtocolBufferException {
372     return PARSER.parseFrom(data);
373   }
374 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)375   public static io.grafeas.v1beta1.Resource parseFrom(
376       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
377       throws com.google.protobuf.InvalidProtocolBufferException {
378     return PARSER.parseFrom(data, extensionRegistry);
379   }
380 
parseFrom(com.google.protobuf.ByteString data)381   public static io.grafeas.v1beta1.Resource parseFrom(com.google.protobuf.ByteString data)
382       throws com.google.protobuf.InvalidProtocolBufferException {
383     return PARSER.parseFrom(data);
384   }
385 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)386   public static io.grafeas.v1beta1.Resource parseFrom(
387       com.google.protobuf.ByteString data,
388       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
389       throws com.google.protobuf.InvalidProtocolBufferException {
390     return PARSER.parseFrom(data, extensionRegistry);
391   }
392 
parseFrom(byte[] data)393   public static io.grafeas.v1beta1.Resource parseFrom(byte[] data)
394       throws com.google.protobuf.InvalidProtocolBufferException {
395     return PARSER.parseFrom(data);
396   }
397 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)398   public static io.grafeas.v1beta1.Resource parseFrom(
399       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
400       throws com.google.protobuf.InvalidProtocolBufferException {
401     return PARSER.parseFrom(data, extensionRegistry);
402   }
403 
parseFrom(java.io.InputStream input)404   public static io.grafeas.v1beta1.Resource parseFrom(java.io.InputStream input)
405       throws java.io.IOException {
406     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
407   }
408 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)409   public static io.grafeas.v1beta1.Resource parseFrom(
410       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
411       throws java.io.IOException {
412     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
413         PARSER, input, extensionRegistry);
414   }
415 
parseDelimitedFrom(java.io.InputStream input)416   public static io.grafeas.v1beta1.Resource parseDelimitedFrom(java.io.InputStream input)
417       throws java.io.IOException {
418     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
419   }
420 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)421   public static io.grafeas.v1beta1.Resource parseDelimitedFrom(
422       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
423       throws java.io.IOException {
424     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
425         PARSER, input, extensionRegistry);
426   }
427 
parseFrom(com.google.protobuf.CodedInputStream input)428   public static io.grafeas.v1beta1.Resource parseFrom(com.google.protobuf.CodedInputStream input)
429       throws java.io.IOException {
430     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
431   }
432 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)433   public static io.grafeas.v1beta1.Resource parseFrom(
434       com.google.protobuf.CodedInputStream input,
435       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
436       throws java.io.IOException {
437     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
438         PARSER, input, extensionRegistry);
439   }
440 
441   @java.lang.Override
newBuilderForType()442   public Builder newBuilderForType() {
443     return newBuilder();
444   }
445 
newBuilder()446   public static Builder newBuilder() {
447     return DEFAULT_INSTANCE.toBuilder();
448   }
449 
newBuilder(io.grafeas.v1beta1.Resource prototype)450   public static Builder newBuilder(io.grafeas.v1beta1.Resource prototype) {
451     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
452   }
453 
454   @java.lang.Override
toBuilder()455   public Builder toBuilder() {
456     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
457   }
458 
459   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)460   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
461     Builder builder = new Builder(parent);
462     return builder;
463   }
464   /**
465    *
466    *
467    * <pre>
468    * An entity that can have metadata. For example, a Docker image.
469    * </pre>
470    *
471    * Protobuf type {@code grafeas.v1beta1.Resource}
472    */
473   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
474       implements
475       // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.Resource)
476       io.grafeas.v1beta1.ResourceOrBuilder {
getDescriptor()477     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
478       return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Resource_descriptor;
479     }
480 
481     @java.lang.Override
482     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()483         internalGetFieldAccessorTable() {
484       return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Resource_fieldAccessorTable
485           .ensureFieldAccessorsInitialized(
486               io.grafeas.v1beta1.Resource.class, io.grafeas.v1beta1.Resource.Builder.class);
487     }
488 
489     // Construct using io.grafeas.v1beta1.Resource.newBuilder()
Builder()490     private Builder() {
491       maybeForceBuilderInitialization();
492     }
493 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)494     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
495       super(parent);
496       maybeForceBuilderInitialization();
497     }
498 
maybeForceBuilderInitialization()499     private void maybeForceBuilderInitialization() {
500       if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
501     }
502 
503     @java.lang.Override
clear()504     public Builder clear() {
505       super.clear();
506       name_ = "";
507 
508       uri_ = "";
509 
510       if (contentHashBuilder_ == null) {
511         contentHash_ = null;
512       } else {
513         contentHash_ = null;
514         contentHashBuilder_ = null;
515       }
516       return this;
517     }
518 
519     @java.lang.Override
getDescriptorForType()520     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
521       return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Resource_descriptor;
522     }
523 
524     @java.lang.Override
getDefaultInstanceForType()525     public io.grafeas.v1beta1.Resource getDefaultInstanceForType() {
526       return io.grafeas.v1beta1.Resource.getDefaultInstance();
527     }
528 
529     @java.lang.Override
build()530     public io.grafeas.v1beta1.Resource build() {
531       io.grafeas.v1beta1.Resource result = buildPartial();
532       if (!result.isInitialized()) {
533         throw newUninitializedMessageException(result);
534       }
535       return result;
536     }
537 
538     @java.lang.Override
buildPartial()539     public io.grafeas.v1beta1.Resource buildPartial() {
540       io.grafeas.v1beta1.Resource result = new io.grafeas.v1beta1.Resource(this);
541       result.name_ = name_;
542       result.uri_ = uri_;
543       if (contentHashBuilder_ == null) {
544         result.contentHash_ = contentHash_;
545       } else {
546         result.contentHash_ = contentHashBuilder_.build();
547       }
548       onBuilt();
549       return result;
550     }
551 
552     @java.lang.Override
clone()553     public Builder clone() {
554       return super.clone();
555     }
556 
557     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)558     public Builder setField(
559         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
560       return super.setField(field, value);
561     }
562 
563     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)564     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
565       return super.clearField(field);
566     }
567 
568     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)569     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
570       return super.clearOneof(oneof);
571     }
572 
573     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)574     public Builder setRepeatedField(
575         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
576       return super.setRepeatedField(field, index, value);
577     }
578 
579     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)580     public Builder addRepeatedField(
581         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
582       return super.addRepeatedField(field, value);
583     }
584 
585     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)586     public Builder mergeFrom(com.google.protobuf.Message other) {
587       if (other instanceof io.grafeas.v1beta1.Resource) {
588         return mergeFrom((io.grafeas.v1beta1.Resource) other);
589       } else {
590         super.mergeFrom(other);
591         return this;
592       }
593     }
594 
mergeFrom(io.grafeas.v1beta1.Resource other)595     public Builder mergeFrom(io.grafeas.v1beta1.Resource other) {
596       if (other == io.grafeas.v1beta1.Resource.getDefaultInstance()) return this;
597       if (!other.getName().isEmpty()) {
598         name_ = other.name_;
599         onChanged();
600       }
601       if (!other.getUri().isEmpty()) {
602         uri_ = other.uri_;
603         onChanged();
604       }
605       if (other.hasContentHash()) {
606         mergeContentHash(other.getContentHash());
607       }
608       this.mergeUnknownFields(other.unknownFields);
609       onChanged();
610       return this;
611     }
612 
613     @java.lang.Override
isInitialized()614     public final boolean isInitialized() {
615       return true;
616     }
617 
618     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)619     public Builder mergeFrom(
620         com.google.protobuf.CodedInputStream input,
621         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
622         throws java.io.IOException {
623       io.grafeas.v1beta1.Resource parsedMessage = null;
624       try {
625         parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
626       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
627         parsedMessage = (io.grafeas.v1beta1.Resource) e.getUnfinishedMessage();
628         throw e.unwrapIOException();
629       } finally {
630         if (parsedMessage != null) {
631           mergeFrom(parsedMessage);
632         }
633       }
634       return this;
635     }
636 
637     private java.lang.Object name_ = "";
638     /**
639      *
640      *
641      * <pre>
642      * The name of the resource. For example, the name of a Docker image -
643      * "Debian".
644      * </pre>
645      *
646      * <code>string name = 1;</code>
647      *
648      * @return The name.
649      */
getName()650     public java.lang.String getName() {
651       java.lang.Object ref = name_;
652       if (!(ref instanceof java.lang.String)) {
653         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
654         java.lang.String s = bs.toStringUtf8();
655         name_ = s;
656         return s;
657       } else {
658         return (java.lang.String) ref;
659       }
660     }
661     /**
662      *
663      *
664      * <pre>
665      * The name of the resource. For example, the name of a Docker image -
666      * "Debian".
667      * </pre>
668      *
669      * <code>string name = 1;</code>
670      *
671      * @return The bytes for name.
672      */
getNameBytes()673     public com.google.protobuf.ByteString getNameBytes() {
674       java.lang.Object ref = name_;
675       if (ref instanceof String) {
676         com.google.protobuf.ByteString b =
677             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
678         name_ = b;
679         return b;
680       } else {
681         return (com.google.protobuf.ByteString) ref;
682       }
683     }
684     /**
685      *
686      *
687      * <pre>
688      * The name of the resource. For example, the name of a Docker image -
689      * "Debian".
690      * </pre>
691      *
692      * <code>string name = 1;</code>
693      *
694      * @param value The name to set.
695      * @return This builder for chaining.
696      */
setName(java.lang.String value)697     public Builder setName(java.lang.String value) {
698       if (value == null) {
699         throw new NullPointerException();
700       }
701 
702       name_ = value;
703       onChanged();
704       return this;
705     }
706     /**
707      *
708      *
709      * <pre>
710      * The name of the resource. For example, the name of a Docker image -
711      * "Debian".
712      * </pre>
713      *
714      * <code>string name = 1;</code>
715      *
716      * @return This builder for chaining.
717      */
clearName()718     public Builder clearName() {
719 
720       name_ = getDefaultInstance().getName();
721       onChanged();
722       return this;
723     }
724     /**
725      *
726      *
727      * <pre>
728      * The name of the resource. For example, the name of a Docker image -
729      * "Debian".
730      * </pre>
731      *
732      * <code>string name = 1;</code>
733      *
734      * @param value The bytes for name to set.
735      * @return This builder for chaining.
736      */
setNameBytes(com.google.protobuf.ByteString value)737     public Builder setNameBytes(com.google.protobuf.ByteString value) {
738       if (value == null) {
739         throw new NullPointerException();
740       }
741       checkByteStringIsUtf8(value);
742 
743       name_ = value;
744       onChanged();
745       return this;
746     }
747 
748     private java.lang.Object uri_ = "";
749     /**
750      *
751      *
752      * <pre>
753      * Required. The unique URI of the resource. For example,
754      * `https://gcr.io/project/image&#64;sha256:foo` for a Docker image.
755      * </pre>
756      *
757      * <code>string uri = 2;</code>
758      *
759      * @return The uri.
760      */
getUri()761     public java.lang.String getUri() {
762       java.lang.Object ref = uri_;
763       if (!(ref instanceof java.lang.String)) {
764         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
765         java.lang.String s = bs.toStringUtf8();
766         uri_ = s;
767         return s;
768       } else {
769         return (java.lang.String) ref;
770       }
771     }
772     /**
773      *
774      *
775      * <pre>
776      * Required. The unique URI of the resource. For example,
777      * `https://gcr.io/project/image&#64;sha256:foo` for a Docker image.
778      * </pre>
779      *
780      * <code>string uri = 2;</code>
781      *
782      * @return The bytes for uri.
783      */
getUriBytes()784     public com.google.protobuf.ByteString getUriBytes() {
785       java.lang.Object ref = uri_;
786       if (ref instanceof String) {
787         com.google.protobuf.ByteString b =
788             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
789         uri_ = b;
790         return b;
791       } else {
792         return (com.google.protobuf.ByteString) ref;
793       }
794     }
795     /**
796      *
797      *
798      * <pre>
799      * Required. The unique URI of the resource. For example,
800      * `https://gcr.io/project/image&#64;sha256:foo` for a Docker image.
801      * </pre>
802      *
803      * <code>string uri = 2;</code>
804      *
805      * @param value The uri to set.
806      * @return This builder for chaining.
807      */
setUri(java.lang.String value)808     public Builder setUri(java.lang.String value) {
809       if (value == null) {
810         throw new NullPointerException();
811       }
812 
813       uri_ = value;
814       onChanged();
815       return this;
816     }
817     /**
818      *
819      *
820      * <pre>
821      * Required. The unique URI of the resource. For example,
822      * `https://gcr.io/project/image&#64;sha256:foo` for a Docker image.
823      * </pre>
824      *
825      * <code>string uri = 2;</code>
826      *
827      * @return This builder for chaining.
828      */
clearUri()829     public Builder clearUri() {
830 
831       uri_ = getDefaultInstance().getUri();
832       onChanged();
833       return this;
834     }
835     /**
836      *
837      *
838      * <pre>
839      * Required. The unique URI of the resource. For example,
840      * `https://gcr.io/project/image&#64;sha256:foo` for a Docker image.
841      * </pre>
842      *
843      * <code>string uri = 2;</code>
844      *
845      * @param value The bytes for uri to set.
846      * @return This builder for chaining.
847      */
setUriBytes(com.google.protobuf.ByteString value)848     public Builder setUriBytes(com.google.protobuf.ByteString value) {
849       if (value == null) {
850         throw new NullPointerException();
851       }
852       checkByteStringIsUtf8(value);
853 
854       uri_ = value;
855       onChanged();
856       return this;
857     }
858 
859     private io.grafeas.v1beta1.provenance.Hash contentHash_;
860     private com.google.protobuf.SingleFieldBuilderV3<
861             io.grafeas.v1beta1.provenance.Hash,
862             io.grafeas.v1beta1.provenance.Hash.Builder,
863             io.grafeas.v1beta1.provenance.HashOrBuilder>
864         contentHashBuilder_;
865     /**
866      *
867      *
868      * <pre>
869      * The hash of the resource content. For example, the Docker digest.
870      * </pre>
871      *
872      * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
873      *
874      * @return Whether the contentHash field is set.
875      */
hasContentHash()876     public boolean hasContentHash() {
877       return contentHashBuilder_ != null || contentHash_ != null;
878     }
879     /**
880      *
881      *
882      * <pre>
883      * The hash of the resource content. For example, the Docker digest.
884      * </pre>
885      *
886      * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
887      *
888      * @return The contentHash.
889      */
getContentHash()890     public io.grafeas.v1beta1.provenance.Hash getContentHash() {
891       if (contentHashBuilder_ == null) {
892         return contentHash_ == null
893             ? io.grafeas.v1beta1.provenance.Hash.getDefaultInstance()
894             : contentHash_;
895       } else {
896         return contentHashBuilder_.getMessage();
897       }
898     }
899     /**
900      *
901      *
902      * <pre>
903      * The hash of the resource content. For example, the Docker digest.
904      * </pre>
905      *
906      * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
907      */
setContentHash(io.grafeas.v1beta1.provenance.Hash value)908     public Builder setContentHash(io.grafeas.v1beta1.provenance.Hash value) {
909       if (contentHashBuilder_ == null) {
910         if (value == null) {
911           throw new NullPointerException();
912         }
913         contentHash_ = value;
914         onChanged();
915       } else {
916         contentHashBuilder_.setMessage(value);
917       }
918 
919       return this;
920     }
921     /**
922      *
923      *
924      * <pre>
925      * The hash of the resource content. For example, the Docker digest.
926      * </pre>
927      *
928      * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
929      */
setContentHash(io.grafeas.v1beta1.provenance.Hash.Builder builderForValue)930     public Builder setContentHash(io.grafeas.v1beta1.provenance.Hash.Builder builderForValue) {
931       if (contentHashBuilder_ == null) {
932         contentHash_ = builderForValue.build();
933         onChanged();
934       } else {
935         contentHashBuilder_.setMessage(builderForValue.build());
936       }
937 
938       return this;
939     }
940     /**
941      *
942      *
943      * <pre>
944      * The hash of the resource content. For example, the Docker digest.
945      * </pre>
946      *
947      * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
948      */
mergeContentHash(io.grafeas.v1beta1.provenance.Hash value)949     public Builder mergeContentHash(io.grafeas.v1beta1.provenance.Hash value) {
950       if (contentHashBuilder_ == null) {
951         if (contentHash_ != null) {
952           contentHash_ =
953               io.grafeas.v1beta1.provenance.Hash.newBuilder(contentHash_)
954                   .mergeFrom(value)
955                   .buildPartial();
956         } else {
957           contentHash_ = value;
958         }
959         onChanged();
960       } else {
961         contentHashBuilder_.mergeFrom(value);
962       }
963 
964       return this;
965     }
966     /**
967      *
968      *
969      * <pre>
970      * The hash of the resource content. For example, the Docker digest.
971      * </pre>
972      *
973      * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
974      */
clearContentHash()975     public Builder clearContentHash() {
976       if (contentHashBuilder_ == null) {
977         contentHash_ = null;
978         onChanged();
979       } else {
980         contentHash_ = null;
981         contentHashBuilder_ = null;
982       }
983 
984       return this;
985     }
986     /**
987      *
988      *
989      * <pre>
990      * The hash of the resource content. For example, the Docker digest.
991      * </pre>
992      *
993      * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
994      */
getContentHashBuilder()995     public io.grafeas.v1beta1.provenance.Hash.Builder getContentHashBuilder() {
996 
997       onChanged();
998       return getContentHashFieldBuilder().getBuilder();
999     }
1000     /**
1001      *
1002      *
1003      * <pre>
1004      * The hash of the resource content. For example, the Docker digest.
1005      * </pre>
1006      *
1007      * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
1008      */
getContentHashOrBuilder()1009     public io.grafeas.v1beta1.provenance.HashOrBuilder getContentHashOrBuilder() {
1010       if (contentHashBuilder_ != null) {
1011         return contentHashBuilder_.getMessageOrBuilder();
1012       } else {
1013         return contentHash_ == null
1014             ? io.grafeas.v1beta1.provenance.Hash.getDefaultInstance()
1015             : contentHash_;
1016       }
1017     }
1018     /**
1019      *
1020      *
1021      * <pre>
1022      * The hash of the resource content. For example, the Docker digest.
1023      * </pre>
1024      *
1025      * <code>.grafeas.v1beta1.provenance.Hash content_hash = 3;</code>
1026      */
1027     private com.google.protobuf.SingleFieldBuilderV3<
1028             io.grafeas.v1beta1.provenance.Hash,
1029             io.grafeas.v1beta1.provenance.Hash.Builder,
1030             io.grafeas.v1beta1.provenance.HashOrBuilder>
getContentHashFieldBuilder()1031         getContentHashFieldBuilder() {
1032       if (contentHashBuilder_ == null) {
1033         contentHashBuilder_ =
1034             new com.google.protobuf.SingleFieldBuilderV3<
1035                 io.grafeas.v1beta1.provenance.Hash,
1036                 io.grafeas.v1beta1.provenance.Hash.Builder,
1037                 io.grafeas.v1beta1.provenance.HashOrBuilder>(
1038                 getContentHash(), getParentForChildren(), isClean());
1039         contentHash_ = null;
1040       }
1041       return contentHashBuilder_;
1042     }
1043 
1044     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1045     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1046       return super.setUnknownFields(unknownFields);
1047     }
1048 
1049     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1050     public final Builder mergeUnknownFields(
1051         final com.google.protobuf.UnknownFieldSet unknownFields) {
1052       return super.mergeUnknownFields(unknownFields);
1053     }
1054 
1055     // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.Resource)
1056   }
1057 
1058   // @@protoc_insertion_point(class_scope:grafeas.v1beta1.Resource)
1059   private static final io.grafeas.v1beta1.Resource DEFAULT_INSTANCE;
1060 
1061   static {
1062     DEFAULT_INSTANCE = new io.grafeas.v1beta1.Resource();
1063   }
1064 
getDefaultInstance()1065   public static io.grafeas.v1beta1.Resource getDefaultInstance() {
1066     return DEFAULT_INSTANCE;
1067   }
1068 
1069   private static final com.google.protobuf.Parser<Resource> PARSER =
1070       new com.google.protobuf.AbstractParser<Resource>() {
1071         @java.lang.Override
1072         public Resource parsePartialFrom(
1073             com.google.protobuf.CodedInputStream input,
1074             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1075             throws com.google.protobuf.InvalidProtocolBufferException {
1076           return new Resource(input, extensionRegistry);
1077         }
1078       };
1079 
parser()1080   public static com.google.protobuf.Parser<Resource> parser() {
1081     return PARSER;
1082   }
1083 
1084   @java.lang.Override
getParserForType()1085   public com.google.protobuf.Parser<Resource> getParserForType() {
1086     return PARSER;
1087   }
1088 
1089   @java.lang.Override
getDefaultInstanceForType()1090   public io.grafeas.v1beta1.Resource getDefaultInstanceForType() {
1091     return DEFAULT_INSTANCE;
1092   }
1093 }
1094