Class Attribute (0.2.0)

public final class Attribute extends GeneratedMessageV3 implements AttributeOrBuilder

An attribute in the API Hub. An attribute is a name value pair which can be attached to different resources in the API hub based on the scope of the attribute. Attributes can either be pre-defined by the API Hub or created by users.

Protobuf type google.cloud.apihub.v1.Attribute

Implements

AttributeOrBuilder

Static Fields

ALLOWED_VALUES_FIELD_NUMBER

public static final int ALLOWED_VALUES_FIELD_NUMBER
Field Value
Type Description
int

CARDINALITY_FIELD_NUMBER

public static final int CARDINALITY_FIELD_NUMBER
Field Value
Type Description
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

DATA_TYPE_FIELD_NUMBER

public static final int DATA_TYPE_FIELD_NUMBER
Field Value
Type Description
int

DEFINITION_TYPE_FIELD_NUMBER

public static final int DEFINITION_TYPE_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
Type Description
int

MANDATORY_FIELD_NUMBER

public static final int MANDATORY_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

SCOPE_FIELD_NUMBER

public static final int SCOPE_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Attribute getDefaultInstance()
Returns
Type Description
Attribute

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Attribute.Builder newBuilder()
Returns
Type Description
Attribute.Builder

newBuilder(Attribute prototype)

public static Attribute.Builder newBuilder(Attribute prototype)
Parameter
Name Description
prototype Attribute
Returns
Type Description
Attribute.Builder

parseDelimitedFrom(InputStream input)

public static Attribute parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Attribute
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Attribute parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Attribute
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Attribute parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Attribute
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Attribute parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Attribute
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Attribute parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Attribute
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Attribute parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Attribute
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Attribute parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Attribute
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Attribute parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Attribute
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Attribute parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Attribute
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Attribute parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Attribute
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Attribute parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Attribute
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Attribute parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Attribute
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Attribute> parser()
Returns
Type Description
Parser<Attribute>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAllowedValues(int index)

public Attribute.AllowedValue getAllowedValues(int index)

Optional. The list of allowed values when the attribute value is of type enum. This is required when the data_type of the attribute is ENUM. The maximum number of allowed values of an attribute will be 1000.

repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Attribute.AllowedValue

getAllowedValuesCount()

public int getAllowedValuesCount()

Optional. The list of allowed values when the attribute value is of type enum. This is required when the data_type of the attribute is ENUM. The maximum number of allowed values of an attribute will be 1000.

repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getAllowedValuesList()

public List<Attribute.AllowedValue> getAllowedValuesList()

Optional. The list of allowed values when the attribute value is of type enum. This is required when the data_type of the attribute is ENUM. The maximum number of allowed values of an attribute will be 1000.

repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<AllowedValue>

getAllowedValuesOrBuilder(int index)

public Attribute.AllowedValueOrBuilder getAllowedValuesOrBuilder(int index)

Optional. The list of allowed values when the attribute value is of type enum. This is required when the data_type of the attribute is ENUM. The maximum number of allowed values of an attribute will be 1000.

repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Attribute.AllowedValueOrBuilder

getAllowedValuesOrBuilderList()

public List<? extends Attribute.AllowedValueOrBuilder> getAllowedValuesOrBuilderList()

Optional. The list of allowed values when the attribute value is of type enum. This is required when the data_type of the attribute is ENUM. The maximum number of allowed values of an attribute will be 1000.

repeated .google.cloud.apihub.v1.Attribute.AllowedValue allowed_values = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.cloud.apihub.v1.Attribute.AllowedValueOrBuilder>

getCardinality()

public int getCardinality()

Optional. The maximum number of values that the attribute can have when associated with an API Hub resource. Cardinality 1 would represent a single-valued attribute. It must not be less than 1 or greater than 20. If not specified, the cardinality would be set to 1 by default and represent a single-valued attribute.

int32 cardinality = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The cardinality.

getCreateTime()

public Timestamp getCreateTime()

Output only. The time at which the attribute was created.

.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. The time at which the attribute was created.

.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDataType()

public Attribute.DataType getDataType()

Required. The type of the data of the attribute.

.google.cloud.apihub.v1.Attribute.DataType data_type = 6 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Attribute.DataType

The dataType.

getDataTypeValue()

public int getDataTypeValue()

Required. The type of the data of the attribute.

.google.cloud.apihub.v1.Attribute.DataType data_type = 6 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for dataType.

getDefaultInstanceForType()

public Attribute getDefaultInstanceForType()
Returns
Type Description
Attribute

getDefinitionType()

public Attribute.DefinitionType getDefinitionType()

Output only. The definition type of the attribute.

.google.cloud.apihub.v1.Attribute.DefinitionType definition_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Attribute.DefinitionType

The definitionType.

getDefinitionTypeValue()

public int getDefinitionTypeValue()

Output only. The definition type of the attribute.

.google.cloud.apihub.v1.Attribute.DefinitionType definition_type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for definitionType.

getDescription()

public String getDescription()

Optional. The description of the attribute.

string description = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Optional. The description of the attribute.

string description = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for description.

getDisplayName()

public String getDisplayName()

Required. The display name of the attribute.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Required. The display name of the attribute.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for displayName.

getMandatory()

public boolean getMandatory()

Output only. When mandatory is true, the attribute is mandatory for the resource specified in the scope. Only System defined attributes can be mandatory.

bool mandatory = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

The mandatory.

getName()

public String getName()

Identifier. The name of the attribute in the API Hub.

Format: projects/{project}/locations/{location}/attributes/{attribute}

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Identifier. The name of the attribute in the API Hub.

Format: projects/{project}/locations/{location}/attributes/{attribute}

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<Attribute> getParserForType()
Returns
Type Description
Parser<Attribute>
Overrides

getScope()

public Attribute.Scope getScope()

Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked.

.google.cloud.apihub.v1.Attribute.Scope scope = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Attribute.Scope

The scope.

getScopeValue()

public int getScopeValue()

Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked.

.google.cloud.apihub.v1.Attribute.Scope scope = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for scope.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getUpdateTime()

public Timestamp getUpdateTime()

Output only. The time at which the attribute was last updated.

.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The updateTime.

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. The time at which the attribute was last updated.

.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

hasCreateTime()

public boolean hasCreateTime()

Output only. The time at which the attribute was created.

.google.protobuf.Timestamp create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

hasUpdateTime()

public boolean hasUpdateTime()

Output only. The time at which the attribute was last updated.

.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the updateTime field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Attribute.Builder newBuilderForType()
Returns
Type Description
Attribute.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Attribute.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Attribute.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Attribute.Builder toBuilder()
Returns
Type Description
Attribute.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException