Class Resource.Builder (2.41.0)

public static final class Resource.Builder extends GeneratedMessageV3.Builder<Resource.Builder> implements ResourceOrBuilder

An entity that can have metadata. For example, a Docker image.

Protobuf type grafeas.v1beta1.Resource

Implements

ResourceOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Resource.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Resource.Builder
Overrides

build()

public Resource build()
Returns
TypeDescription
Resource

buildPartial()

public Resource buildPartial()
Returns
TypeDescription
Resource

clear()

public Resource.Builder clear()
Returns
TypeDescription
Resource.Builder
Overrides

clearContentHash()

public Resource.Builder clearContentHash()

The hash of the resource content. For example, the Docker digest.

.grafeas.v1beta1.provenance.Hash content_hash = 3;

Returns
TypeDescription
Resource.Builder

clearField(Descriptors.FieldDescriptor field)

public Resource.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Resource.Builder
Overrides

clearName()

public Resource.Builder clearName()

The name of the resource. For example, the name of a Docker image - "Debian".

string name = 1;

Returns
TypeDescription
Resource.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Resource.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Resource.Builder
Overrides

clearUri()

public Resource.Builder clearUri()

Required. The unique URI of the resource. For example, https://gcr.io/project/image@sha256:foo for a Docker image.

string uri = 2;

Returns
TypeDescription
Resource.Builder

This builder for chaining.

clone()

public Resource.Builder clone()
Returns
TypeDescription
Resource.Builder
Overrides

getContentHash()

public Hash getContentHash()

The hash of the resource content. For example, the Docker digest.

.grafeas.v1beta1.provenance.Hash content_hash = 3;

Returns
TypeDescription
Hash

The contentHash.

getContentHashBuilder()

public Hash.Builder getContentHashBuilder()

The hash of the resource content. For example, the Docker digest.

.grafeas.v1beta1.provenance.Hash content_hash = 3;

Returns
TypeDescription
Hash.Builder

getContentHashOrBuilder()

public HashOrBuilder getContentHashOrBuilder()

The hash of the resource content. For example, the Docker digest.

.grafeas.v1beta1.provenance.Hash content_hash = 3;

Returns
TypeDescription
HashOrBuilder

getDefaultInstanceForType()

public Resource getDefaultInstanceForType()
Returns
TypeDescription
Resource

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getName()

public String getName()

The name of the resource. For example, the name of a Docker image - "Debian".

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

The name of the resource. For example, the name of a Docker image - "Debian".

string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getUri()

public String getUri()

Required. The unique URI of the resource. For example, https://gcr.io/project/image@sha256:foo for a Docker image.

string uri = 2;

Returns
TypeDescription
String

The uri.

getUriBytes()

public ByteString getUriBytes()

Required. The unique URI of the resource. For example, https://gcr.io/project/image@sha256:foo for a Docker image.

string uri = 2;

Returns
TypeDescription
ByteString

The bytes for uri.

hasContentHash()

public boolean hasContentHash()

The hash of the resource content. For example, the Docker digest.

.grafeas.v1beta1.provenance.Hash content_hash = 3;

Returns
TypeDescription
boolean

Whether the contentHash field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeContentHash(Hash value)

public Resource.Builder mergeContentHash(Hash value)

The hash of the resource content. For example, the Docker digest.

.grafeas.v1beta1.provenance.Hash content_hash = 3;

Parameter
NameDescription
valueHash
Returns
TypeDescription
Resource.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Resource.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Resource.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Resource.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Resource.Builder
Overrides

mergeFrom(Resource other)

public Resource.Builder mergeFrom(Resource other)
Parameter
NameDescription
otherResource
Returns
TypeDescription
Resource.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Resource.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Resource.Builder
Overrides

setContentHash(Hash value)

public Resource.Builder setContentHash(Hash value)

The hash of the resource content. For example, the Docker digest.

.grafeas.v1beta1.provenance.Hash content_hash = 3;

Parameter
NameDescription
valueHash
Returns
TypeDescription
Resource.Builder

setContentHash(Hash.Builder builderForValue)

public Resource.Builder setContentHash(Hash.Builder builderForValue)

The hash of the resource content. For example, the Docker digest.

.grafeas.v1beta1.provenance.Hash content_hash = 3;

Parameter
NameDescription
builderForValueHash.Builder
Returns
TypeDescription
Resource.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Resource.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Resource.Builder
Overrides

setName(String value)

public Resource.Builder setName(String value)

The name of the resource. For example, the name of a Docker image - "Debian".

string name = 1;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
Resource.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Resource.Builder setNameBytes(ByteString value)

The name of the resource. For example, the name of a Docker image - "Debian".

string name = 1;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
Resource.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Resource.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Resource.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Resource.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Resource.Builder
Overrides

setUri(String value)

public Resource.Builder setUri(String value)

Required. The unique URI of the resource. For example, https://gcr.io/project/image@sha256:foo for a Docker image.

string uri = 2;

Parameter
NameDescription
valueString

The uri to set.

Returns
TypeDescription
Resource.Builder

This builder for chaining.

setUriBytes(ByteString value)

public Resource.Builder setUriBytes(ByteString value)

Required. The unique URI of the resource. For example, https://gcr.io/project/image@sha256:foo for a Docker image.

string uri = 2;

Parameter
NameDescription
valueByteString

The bytes for uri to set.

Returns
TypeDescription
Resource.Builder

This builder for chaining.