# Interface HubOrBuilder (0.16.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.16.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkconnectivity.v1.HubOrBuilder)
- [0.15.0](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.networkconnectivity.v1.HubOrBuilder)
- [0.14.1](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.networkconnectivity.v1.HubOrBuilder)

    public interface HubOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### containsLabels(String key)

    public abstract boolean containsLabels(String key)

Optional labels in key:value format. For more information about labels, see
[Requirements for
labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).

`map<string, string> labels = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getCreateTime()

    public abstract Timestamp getCreateTime()

Output only. The time the hub was created.

`.google.protobuf.Timestamp create_time = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The createTime. |

### getCreateTimeOrBuilder()

    public abstract TimestampOrBuilder getCreateTimeOrBuilder()

Output only. The time the hub was created.

`.google.protobuf.Timestamp create_time = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### getDescription()

    public abstract String getDescription()

An optional description of the hub.

`string description = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The description. |

### getDescriptionBytes()

    public abstract ByteString getDescriptionBytes()

An optional description of the hub.

`string description = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for description. |

### getLabels()

    public abstract Map<String,String> getLabels()

Use [#getLabelsMap()](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkconnectivity.v1.HubOrBuilder#com_google_events_cloud_networkconnectivity_v1_HubOrBuilder_getLabelsMap__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getLabelsCount()

    public abstract int getLabelsCount()

Optional labels in key:value format. For more information about labels, see
[Requirements for
labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).

`map<string, string> labels = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getLabelsMap()

    public abstract Map<String,String> getLabelsMap()

Optional labels in key:value format. For more information about labels, see
[Requirements for
labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).

`map<string, string> labels = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getLabelsOrDefault(String key, String defaultValue)

    public abstract String getLabelsOrDefault(String key, String defaultValue)

Optional labels in key:value format. For more information about labels, see
[Requirements for
labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).

`map<string, string> labels = 4;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `defaultValue` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getLabelsOrThrow(String key)

    public abstract String getLabelsOrThrow(String key)

Optional labels in key:value format. For more information about labels, see
[Requirements for
labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).

`map<string, string> labels = 4;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getName()

    public abstract String getName()

Immutable. The name of the hub. Hub names must be unique. They use the
following form:
`projects/{project_number}/locations/global/hubs/{hub_id}`

`string name = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The name. |

### getNameBytes()

    public abstract ByteString getNameBytes()

Immutable. The name of the hub. Hub names must be unique. They use the
following form:
`projects/{project_number}/locations/global/hubs/{hub_id}`

`string name = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for name. |

### getRoutingVpcs(int index)

    public abstract RoutingVPC getRoutingVpcs(int index)

The VPC networks associated with this hub's spokes.
This field is read-only. Network Connectivity Center automatically
populates it based on the set of spokes attached to the hub.

`repeated .google.events.cloud.networkconnectivity.v1.RoutingVPC routing_vpcs = 10;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkconnectivity.v1.RoutingVPC` |   |

### getRoutingVpcsCount()

    public abstract int getRoutingVpcsCount()

The VPC networks associated with this hub's spokes.
This field is read-only. Network Connectivity Center automatically
populates it based on the set of spokes attached to the hub.

`repeated .google.events.cloud.networkconnectivity.v1.RoutingVPC routing_vpcs = 10;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getRoutingVpcsList()

    public abstract List<RoutingVPC> getRoutingVpcsList()

The VPC networks associated with this hub's spokes.
This field is read-only. Network Connectivity Center automatically
populates it based on the set of spokes attached to the hub.

`repeated .google.events.cloud.networkconnectivity.v1.RoutingVPC routing_vpcs = 10;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkconnectivity.v1.RoutingVPC>` |   |

### getRoutingVpcsOrBuilder(int index)

    public abstract RoutingVPCOrBuilder getRoutingVpcsOrBuilder(int index)

The VPC networks associated with this hub's spokes.
This field is read-only. Network Connectivity Center automatically
populates it based on the set of spokes attached to the hub.

`repeated .google.events.cloud.networkconnectivity.v1.RoutingVPC routing_vpcs = 10;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkconnectivity.v1.RoutingVPCOrBuilder` |   |

### getRoutingVpcsOrBuilderList()

    public abstract List<? extends RoutingVPCOrBuilder> getRoutingVpcsOrBuilderList()

The VPC networks associated with this hub's spokes.
This field is read-only. Network Connectivity Center automatically
populates it based on the set of spokes attached to the hub.

`repeated .google.events.cloud.networkconnectivity.v1.RoutingVPC routing_vpcs = 10;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.events.cloud.networkconnectivity.v1.RoutingVPCOrBuilder>` |   |

### getState()

    public abstract State getState()

Output only. The current lifecycle state of this hub.

`.google.events.cloud.networkconnectivity.v1.State state = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkconnectivity.v1.State` | The state. |

### getStateValue()

    public abstract int getStateValue()

Output only. The current lifecycle state of this hub.

`.google.events.cloud.networkconnectivity.v1.State state = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for state. |

### getUniqueId()

    public abstract String getUniqueId()

Output only. The Google-generated UUID for the hub. This value is unique
across all hub resources. If a hub is deleted and another with the same
name is created, the new hub is assigned a different unique_id.

`string unique_id = 8;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The uniqueId. |

### getUniqueIdBytes()

    public abstract ByteString getUniqueIdBytes()

Output only. The Google-generated UUID for the hub. This value is unique
across all hub resources. If a hub is deleted and another with the same
name is created, the new hub is assigned a different unique_id.

`string unique_id = 8;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for uniqueId. |

### getUpdateTime()

    public abstract Timestamp getUpdateTime()

Output only. The time the hub was last updated.

`.google.protobuf.Timestamp update_time = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The updateTime. |

### getUpdateTimeOrBuilder()

    public abstract TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. The time the hub was last updated.

`.google.protobuf.Timestamp update_time = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### hasCreateTime()

    public abstract boolean hasCreateTime()

Output only. The time the hub was created.

`.google.protobuf.Timestamp create_time = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the createTime field is set. |

### hasUpdateTime()

    public abstract boolean hasUpdateTime()

Output only. The time the hub was last updated.

`.google.protobuf.Timestamp update_time = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the updateTime field is set. |