# Interface GrpcRoute.RouteRuleOrBuilder (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.networkservices.v1.GrpcRoute.RouteRuleOrBuilder)
- [0.15.0](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.networkservices.v1.GrpcRoute.RouteRuleOrBuilder)
- [0.14.1](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.networkservices.v1.GrpcRoute.RouteRuleOrBuilder)

    public static interface GrpcRoute.RouteRuleOrBuilder extends MessageOrBuilder

## Implements

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

## Methods

### getAction()

    public abstract GrpcRoute.RouteAction getAction()

Required. A detailed rule defining how to route traffic. This field is
required.

`.google.events.cloud.networkservices.v1.GrpcRoute.RouteAction action = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkservices.v1.GrpcRoute.RouteAction` | The action. |

### getActionOrBuilder()

    public abstract GrpcRoute.RouteActionOrBuilder getActionOrBuilder()

Required. A detailed rule defining how to route traffic. This field is
required.

`.google.events.cloud.networkservices.v1.GrpcRoute.RouteAction action = 2;`

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

### getMatches(int index)

    public abstract GrpcRoute.RouteMatch getMatches(int index)

Optional. Matches define conditions used for matching the rule against
incoming gRPC requests. Each match is independent, i.e. this rule will be
matched if ANY one of the matches is satisfied. If no matches field is
specified, this rule will unconditionally match traffic.

`repeated .google.events.cloud.networkservices.v1.GrpcRoute.RouteMatch matches = 1;
`

| **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.networkservices.v1.GrpcRoute.RouteMatch` |   |

### getMatchesCount()

    public abstract int getMatchesCount()

Optional. Matches define conditions used for matching the rule against
incoming gRPC requests. Each match is independent, i.e. this rule will be
matched if ANY one of the matches is satisfied. If no matches field is
specified, this rule will unconditionally match traffic.

`repeated .google.events.cloud.networkservices.v1.GrpcRoute.RouteMatch matches = 1;
`

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

### getMatchesList()

    public abstract List<GrpcRoute.RouteMatch> getMatchesList()

Optional. Matches define conditions used for matching the rule against
incoming gRPC requests. Each match is independent, i.e. this rule will be
matched if ANY one of the matches is satisfied. If no matches field is
specified, this rule will unconditionally match traffic.

`repeated .google.events.cloud.networkservices.v1.GrpcRoute.RouteMatch matches = 1;
`

| **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.networkservices.v1.GrpcRoute.RouteMatch>` |   |

### getMatchesOrBuilder(int index)

    public abstract GrpcRoute.RouteMatchOrBuilder getMatchesOrBuilder(int index)

Optional. Matches define conditions used for matching the rule against
incoming gRPC requests. Each match is independent, i.e. this rule will be
matched if ANY one of the matches is satisfied. If no matches field is
specified, this rule will unconditionally match traffic.

`repeated .google.events.cloud.networkservices.v1.GrpcRoute.RouteMatch matches = 1;
`

| **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.networkservices.v1.GrpcRoute.RouteMatchOrBuilder` |   |

### getMatchesOrBuilderList()

    public abstract List<? extends GrpcRoute.RouteMatchOrBuilder> getMatchesOrBuilderList()

Optional. Matches define conditions used for matching the rule against
incoming gRPC requests. Each match is independent, i.e. this rule will be
matched if ANY one of the matches is satisfied. If no matches field is
specified, this rule will unconditionally match traffic.

`repeated .google.events.cloud.networkservices.v1.GrpcRoute.RouteMatch matches = 1;
`

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

### hasAction()

    public abstract boolean hasAction()

Required. A detailed rule defining how to route traffic. This field is
required.

`.google.events.cloud.networkservices.v1.GrpcRoute.RouteAction action = 2;`

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