public com.google.protobuf.ByteString getFilterBytes() {
      java.lang.Object ref = filter_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        filter_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
<pre>
`filter` can be used to specify a subset of tasks to lease.

When `filter` is set to `tag=&lt;my-tag&gt;` then the
[response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only
tasks whose [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to
`&lt;my-tag&gt;`. `&lt;my-tag&gt;` must be less than 500 characters.

When `filter` is set to `tag_function=oldest_tag()`, only tasks which have
the same tag as the task with the oldest
[schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be
returned.

Grammar Syntax:

* `filter = "tag=" tag | "tag_function=" function`

* `tag = string`

* `function = "oldest_tag()"`

The `oldest_tag()` function returns tasks which have the same tag as the
oldest task (ordered by schedule time).

SDK compatibility: Although the SDK allows tags to be either
string or
[bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
only UTF-8 encoded tags can be used in Cloud Tasks. Tag which
aren't UTF-8 encoded can't be used in the
[filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the
task's [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed
as empty in Cloud Tasks.
</pre>

<code>string filter = 5;</code>

@return The bytes for filter.
java-tasks/proto-google-cloud-tasks-v2beta2/src/main/java/com/google/cloud/tasks/v2beta2/LeaseTasksRequest.java