Class Definition.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Definition.Builder>
com.google.cloud.apihub.v1.Definition.Builder
All Implemented Interfaces:
DefinitionOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Definition

public static final class Definition.Builder extends com.google.protobuf.GeneratedMessage.Builder<Definition.Builder> implements DefinitionOrBuilder
 Represents a definition for example schema, request, response definitions
 contained in an API version.
 A definition is added/updated/deleted in an API version when a new spec is
 added or an existing spec is updated/deleted in a version. Currently,
 definition will be created only corresponding to OpenAPI spec as parsing is
 supported for OpenAPI spec. Also, within OpenAPI spec, only `schema` object
 is supported.
 
Protobuf type google.cloud.apihub.v1.Definition
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<Definition.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<Definition.Builder>
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Definition.Builder>
    • clear

      public Definition.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<Definition.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<Definition.Builder>
    • getDefaultInstanceForType

      public Definition getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public Definition build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Definition buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public Definition.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Definition.Builder>
    • mergeFrom

      public Definition.Builder mergeFrom(Definition other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<Definition.Builder>
    • mergeFrom

      public Definition.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Definition.Builder>
      Throws:
      IOException
    • getValueCase

      public Definition.ValueCase getValueCase()
      Specified by:
      getValueCase in interface DefinitionOrBuilder
    • clearValue

      public Definition.Builder clearValue()
    • hasSchema

      public boolean hasSchema()
       Output only. The value of a schema definition.
       
      .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasSchema in interface DefinitionOrBuilder
      Returns:
      Whether the schema field is set.
    • getSchema

      public Schema getSchema()
       Output only. The value of a schema definition.
       
      .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSchema in interface DefinitionOrBuilder
      Returns:
      The schema.
    • setSchema

      public Definition.Builder setSchema(Schema value)
       Output only. The value of a schema definition.
       
      .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • setSchema

      public Definition.Builder setSchema(Schema.Builder builderForValue)
       Output only. The value of a schema definition.
       
      .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • mergeSchema

      public Definition.Builder mergeSchema(Schema value)
       Output only. The value of a schema definition.
       
      .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • clearSchema

      public Definition.Builder clearSchema()
       Output only. The value of a schema definition.
       
      .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getSchemaBuilder

      public Schema.Builder getSchemaBuilder()
       Output only. The value of a schema definition.
       
      .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getSchemaOrBuilder

      public SchemaOrBuilder getSchemaOrBuilder()
       Output only. The value of a schema definition.
       
      .google.cloud.apihub.v1.Schema schema = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSchemaOrBuilder in interface DefinitionOrBuilder
    • getName

      public String getName()
       Identifier. The name of the definition.
      
       Format:
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getName in interface DefinitionOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Identifier. The name of the definition.
      
       Format:
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getNameBytes in interface DefinitionOrBuilder
      Returns:
      The bytes for name.
    • setName

      public Definition.Builder setName(String value)
       Identifier. The name of the definition.
      
       Format:
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public Definition.Builder clearName()
       Identifier. The name of the definition.
      
       Format:
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Returns:
      This builder for chaining.
    • setNameBytes

      public Definition.Builder setNameBytes(com.google.protobuf.ByteString value)
       Identifier. The name of the definition.
      
       Format:
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getSpec

      public String getSpec()
       Output only. The name of the spec from where the definition was parsed.
       Format is
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
       
      string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
      Specified by:
      getSpec in interface DefinitionOrBuilder
      Returns:
      The spec.
    • getSpecBytes

      public com.google.protobuf.ByteString getSpecBytes()
       Output only. The name of the spec from where the definition was parsed.
       Format is
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
       
      string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
      Specified by:
      getSpecBytes in interface DefinitionOrBuilder
      Returns:
      The bytes for spec.
    • setSpec

      public Definition.Builder setSpec(String value)
       Output only. The name of the spec from where the definition was parsed.
       Format is
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
       
      string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
      Parameters:
      value - The spec to set.
      Returns:
      This builder for chaining.
    • clearSpec

      public Definition.Builder clearSpec()
       Output only. The name of the spec from where the definition was parsed.
       Format is
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
       
      string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
      Returns:
      This builder for chaining.
    • setSpecBytes

      public Definition.Builder setSpecBytes(com.google.protobuf.ByteString value)
       Output only. The name of the spec from where the definition was parsed.
       Format is
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
       
      string spec = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
      Parameters:
      value - The bytes for spec to set.
      Returns:
      This builder for chaining.
    • getTypeValue

      public int getTypeValue()
       Output only. The type of the definition.
       
      .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getTypeValue in interface DefinitionOrBuilder
      Returns:
      The enum numeric value on the wire for type.
    • setTypeValue

      public Definition.Builder setTypeValue(int value)
       Output only. The type of the definition.
       
      .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The enum numeric value on the wire for type to set.
      Returns:
      This builder for chaining.
    • getType

      public Definition.Type getType()
       Output only. The type of the definition.
       
      .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getType in interface DefinitionOrBuilder
      Returns:
      The type.
    • setType

      public Definition.Builder setType(Definition.Type value)
       Output only. The type of the definition.
       
      .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The type to set.
      Returns:
      This builder for chaining.
    • clearType

      public Definition.Builder clearType()
       Output only. The type of the definition.
       
      .google.cloud.apihub.v1.Definition.Type type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Returns:
      This builder for chaining.
    • hasCreateTime

      public boolean hasCreateTime()
       Output only. The time at which the definition was created.
       
      .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasCreateTime in interface DefinitionOrBuilder
      Returns:
      Whether the createTime field is set.
    • getCreateTime

      public com.google.protobuf.Timestamp getCreateTime()
       Output only. The time at which the definition was created.
       
      .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTime in interface DefinitionOrBuilder
      Returns:
      The createTime.
    • setCreateTime

      public Definition.Builder setCreateTime(com.google.protobuf.Timestamp value)
       Output only. The time at which the definition was created.
       
      .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • setCreateTime

      public Definition.Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue)
       Output only. The time at which the definition was created.
       
      .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • mergeCreateTime

      public Definition.Builder mergeCreateTime(com.google.protobuf.Timestamp value)
       Output only. The time at which the definition was created.
       
      .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • clearCreateTime

      public Definition.Builder clearCreateTime()
       Output only. The time at which the definition was created.
       
      .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getCreateTimeBuilder

      public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder()
       Output only. The time at which the definition was created.
       
      .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getCreateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder()
       Output only. The time at which the definition was created.
       
      .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTimeOrBuilder in interface DefinitionOrBuilder
    • hasUpdateTime

      public boolean hasUpdateTime()
       Output only. The time at which the definition was last updated.
       
      .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasUpdateTime in interface DefinitionOrBuilder
      Returns:
      Whether the updateTime field is set.
    • getUpdateTime

      public com.google.protobuf.Timestamp getUpdateTime()
       Output only. The time at which the definition was last updated.
       
      .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUpdateTime in interface DefinitionOrBuilder
      Returns:
      The updateTime.
    • setUpdateTime

      public Definition.Builder setUpdateTime(com.google.protobuf.Timestamp value)
       Output only. The time at which the definition was last updated.
       
      .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • setUpdateTime

      public Definition.Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue)
       Output only. The time at which the definition was last updated.
       
      .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • mergeUpdateTime

      public Definition.Builder mergeUpdateTime(com.google.protobuf.Timestamp value)
       Output only. The time at which the definition was last updated.
       
      .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • clearUpdateTime

      public Definition.Builder clearUpdateTime()
       Output only. The time at which the definition was last updated.
       
      .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getUpdateTimeBuilder

      public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder()
       Output only. The time at which the definition was last updated.
       
      .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getUpdateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder()
       Output only. The time at which the definition was last updated.
       
      .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUpdateTimeOrBuilder in interface DefinitionOrBuilder
    • getAttributesCount

      public int getAttributesCount()
      Description copied from interface: DefinitionOrBuilder
       Optional. The list of user defined attributes associated with the
       definition resource. The key is the attribute name. It will be of the
       format: `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesCount in interface DefinitionOrBuilder
    • containsAttributes

      public boolean containsAttributes(String key)
       Optional. The list of user defined attributes associated with the
       definition resource. The key is the attribute name. It will be of the
       format: `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      containsAttributes in interface DefinitionOrBuilder
    • getAttributes

      @Deprecated public Map<String,AttributeValues> getAttributes()
      Deprecated.
      Use getAttributesMap() instead.
      Specified by:
      getAttributes in interface DefinitionOrBuilder
    • getAttributesMap

      public Map<String,AttributeValues> getAttributesMap()
       Optional. The list of user defined attributes associated with the
       definition resource. The key is the attribute name. It will be of the
       format: `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesMap in interface DefinitionOrBuilder
    • getAttributesOrDefault

      public AttributeValues getAttributesOrDefault(String key, AttributeValues defaultValue)
       Optional. The list of user defined attributes associated with the
       definition resource. The key is the attribute name. It will be of the
       format: `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesOrDefault in interface DefinitionOrBuilder
    • getAttributesOrThrow

      public AttributeValues getAttributesOrThrow(String key)
       Optional. The list of user defined attributes associated with the
       definition resource. The key is the attribute name. It will be of the
       format: `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesOrThrow in interface DefinitionOrBuilder
    • clearAttributes

      public Definition.Builder clearAttributes()
    • removeAttributes

      public Definition.Builder removeAttributes(String key)
       Optional. The list of user defined attributes associated with the
       definition resource. The key is the attribute name. It will be of the
       format: `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
    • getMutableAttributes

      @Deprecated public Map<String,AttributeValues> getMutableAttributes()
      Deprecated.
      Use alternate mutation accessors instead.
    • putAttributes

      public Definition.Builder putAttributes(String key, AttributeValues value)
       Optional. The list of user defined attributes associated with the
       definition resource. The key is the attribute name. It will be of the
       format: `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
    • putAllAttributes

      public Definition.Builder putAllAttributes(Map<String,AttributeValues> values)
       Optional. The list of user defined attributes associated with the
       definition resource. The key is the attribute name. It will be of the
       format: `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL];
    • putAttributesBuilderIfAbsent

      public AttributeValues.Builder putAttributesBuilderIfAbsent(String key)
       Optional. The list of user defined attributes associated with the
       definition resource. The key is the attribute name. It will be of the
       format: `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 7 [(.google.api.field_behavior) = OPTIONAL];