Class Cohort.Builder (0.54.0)

public static final class Cohort.Builder extends GeneratedMessageV3.Builder<Cohort.Builder> implements CohortOrBuilder

Defines a cohort selection criteria. A cohort is a group of users who share a common characteristic. For example, users with the same firstSessionDate belong to the same cohort.

Protobuf type google.analytics.data.v1alpha.Cohort

Implements

CohortOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Cohort.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Cohort.Builder
Overrides

build()

public Cohort build()
Returns
Type Description
Cohort

buildPartial()

public Cohort buildPartial()
Returns
Type Description
Cohort

clear()

public Cohort.Builder clear()
Returns
Type Description
Cohort.Builder
Overrides

clearDateRange()

public Cohort.Builder clearDateRange()

The cohort selects users whose first touch date is between start date and end date defined in the dateRange. This dateRange does not specify the full date range of event data that is present in a cohort report. In a cohort report, this dateRange is extended by the granularity and offset present in the cohortsRange; event data for the extended reporting date range is present in a cohort report.

In a cohort request, this dateRange is required and the dateRanges in the RunReportRequest or RunPivotReportRequest must be unspecified.

This dateRange should generally be aligned with the cohort's granularity. If CohortsRange uses daily granularity, this dateRange can be a single day. If CohortsRange uses weekly granularity, this dateRange can be aligned to a week boundary, starting at Sunday and ending Saturday. If CohortsRange uses monthly granularity, this dateRange can be aligned to a month, starting at the first and ending on the last day of the month.

.google.analytics.data.v1alpha.DateRange date_range = 3;

Returns
Type Description
Cohort.Builder

clearDimension()

public Cohort.Builder clearDimension()

Dimension used by the cohort. Required and only supports firstSessionDate.

string dimension = 2;

Returns
Type Description
Cohort.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Cohort.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Cohort.Builder
Overrides

clearName()

public Cohort.Builder clearName()

Assigns a name to this cohort. The dimension cohort is valued to this name in a report response. If set, cannot begin with cohort_ or RESERVED_. If not set, cohorts are named by their zero based index cohort_0, cohort_1, etc.

string name = 1;

Returns
Type Description
Cohort.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Cohort.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Cohort.Builder
Overrides

clone()

public Cohort.Builder clone()
Returns
Type Description
Cohort.Builder
Overrides

getDateRange()

public DateRange getDateRange()

The cohort selects users whose first touch date is between start date and end date defined in the dateRange. This dateRange does not specify the full date range of event data that is present in a cohort report. In a cohort report, this dateRange is extended by the granularity and offset present in the cohortsRange; event data for the extended reporting date range is present in a cohort report.

In a cohort request, this dateRange is required and the dateRanges in the RunReportRequest or RunPivotReportRequest must be unspecified.

This dateRange should generally be aligned with the cohort's granularity. If CohortsRange uses daily granularity, this dateRange can be a single day. If CohortsRange uses weekly granularity, this dateRange can be aligned to a week boundary, starting at Sunday and ending Saturday. If CohortsRange uses monthly granularity, this dateRange can be aligned to a month, starting at the first and ending on the last day of the month.

.google.analytics.data.v1alpha.DateRange date_range = 3;

Returns
Type Description
DateRange

The dateRange.

getDateRangeBuilder()

public DateRange.Builder getDateRangeBuilder()

The cohort selects users whose first touch date is between start date and end date defined in the dateRange. This dateRange does not specify the full date range of event data that is present in a cohort report. In a cohort report, this dateRange is extended by the granularity and offset present in the cohortsRange; event data for the extended reporting date range is present in a cohort report.

In a cohort request, this dateRange is required and the dateRanges in the RunReportRequest or RunPivotReportRequest must be unspecified.

This dateRange should generally be aligned with the cohort's granularity. If CohortsRange uses daily granularity, this dateRange can be a single day. If CohortsRange uses weekly granularity, this dateRange can be aligned to a week boundary, starting at Sunday and ending Saturday. If CohortsRange uses monthly granularity, this dateRange can be aligned to a month, starting at the first and ending on the last day of the month.

.google.analytics.data.v1alpha.DateRange date_range = 3;

Returns
Type Description
DateRange.Builder

getDateRangeOrBuilder()

public DateRangeOrBuilder getDateRangeOrBuilder()

The cohort selects users whose first touch date is between start date and end date defined in the dateRange. This dateRange does not specify the full date range of event data that is present in a cohort report. In a cohort report, this dateRange is extended by the granularity and offset present in the cohortsRange; event data for the extended reporting date range is present in a cohort report.

In a cohort request, this dateRange is required and the dateRanges in the RunReportRequest or RunPivotReportRequest must be unspecified.

This dateRange should generally be aligned with the cohort's granularity. If CohortsRange uses daily granularity, this dateRange can be a single day. If CohortsRange uses weekly granularity, this dateRange can be aligned to a week boundary, starting at Sunday and ending Saturday. If CohortsRange uses monthly granularity, this dateRange can be aligned to a month, starting at the first and ending on the last day of the month.

.google.analytics.data.v1alpha.DateRange date_range = 3;

Returns
Type Description
DateRangeOrBuilder

getDefaultInstanceForType()

public Cohort getDefaultInstanceForType()
Returns
Type Description
Cohort

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDimension()

public String getDimension()

Dimension used by the cohort. Required and only supports firstSessionDate.

string dimension = 2;

Returns
Type Description
String

The dimension.

getDimensionBytes()

public ByteString getDimensionBytes()

Dimension used by the cohort. Required and only supports firstSessionDate.

string dimension = 2;

Returns
Type Description
ByteString

The bytes for dimension.

getName()

public String getName()

Assigns a name to this cohort. The dimension cohort is valued to this name in a report response. If set, cannot begin with cohort_ or RESERVED_. If not set, cohorts are named by their zero based index cohort_0, cohort_1, etc.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Assigns a name to this cohort. The dimension cohort is valued to this name in a report response. If set, cannot begin with cohort_ or RESERVED_. If not set, cohorts are named by their zero based index cohort_0, cohort_1, etc.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

hasDateRange()

public boolean hasDateRange()

The cohort selects users whose first touch date is between start date and end date defined in the dateRange. This dateRange does not specify the full date range of event data that is present in a cohort report. In a cohort report, this dateRange is extended by the granularity and offset present in the cohortsRange; event data for the extended reporting date range is present in a cohort report.

In a cohort request, this dateRange is required and the dateRanges in the RunReportRequest or RunPivotReportRequest must be unspecified.

This dateRange should generally be aligned with the cohort's granularity. If CohortsRange uses daily granularity, this dateRange can be a single day. If CohortsRange uses weekly granularity, this dateRange can be aligned to a week boundary, starting at Sunday and ending Saturday. If CohortsRange uses monthly granularity, this dateRange can be aligned to a month, starting at the first and ending on the last day of the month.

.google.analytics.data.v1alpha.DateRange date_range = 3;

Returns
Type Description
boolean

Whether the dateRange field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeDateRange(DateRange value)

public Cohort.Builder mergeDateRange(DateRange value)

The cohort selects users whose first touch date is between start date and end date defined in the dateRange. This dateRange does not specify the full date range of event data that is present in a cohort report. In a cohort report, this dateRange is extended by the granularity and offset present in the cohortsRange; event data for the extended reporting date range is present in a cohort report.

In a cohort request, this dateRange is required and the dateRanges in the RunReportRequest or RunPivotReportRequest must be unspecified.

This dateRange should generally be aligned with the cohort's granularity. If CohortsRange uses daily granularity, this dateRange can be a single day. If CohortsRange uses weekly granularity, this dateRange can be aligned to a week boundary, starting at Sunday and ending Saturday. If CohortsRange uses monthly granularity, this dateRange can be aligned to a month, starting at the first and ending on the last day of the month.

.google.analytics.data.v1alpha.DateRange date_range = 3;

Parameter
Name Description
value DateRange
Returns
Type Description
Cohort.Builder

mergeFrom(Cohort other)

public Cohort.Builder mergeFrom(Cohort other)
Parameter
Name Description
other Cohort
Returns
Type Description
Cohort.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Cohort.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Cohort.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Cohort.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Cohort.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Cohort.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Cohort.Builder
Overrides

setDateRange(DateRange value)

public Cohort.Builder setDateRange(DateRange value)

The cohort selects users whose first touch date is between start date and end date defined in the dateRange. This dateRange does not specify the full date range of event data that is present in a cohort report. In a cohort report, this dateRange is extended by the granularity and offset present in the cohortsRange; event data for the extended reporting date range is present in a cohort report.

In a cohort request, this dateRange is required and the dateRanges in the RunReportRequest or RunPivotReportRequest must be unspecified.

This dateRange should generally be aligned with the cohort's granularity. If CohortsRange uses daily granularity, this dateRange can be a single day. If CohortsRange uses weekly granularity, this dateRange can be aligned to a week boundary, starting at Sunday and ending Saturday. If CohortsRange uses monthly granularity, this dateRange can be aligned to a month, starting at the first and ending on the last day of the month.

.google.analytics.data.v1alpha.DateRange date_range = 3;

Parameter
Name Description
value DateRange
Returns
Type Description
Cohort.Builder

setDateRange(DateRange.Builder builderForValue)

public Cohort.Builder setDateRange(DateRange.Builder builderForValue)

The cohort selects users whose first touch date is between start date and end date defined in the dateRange. This dateRange does not specify the full date range of event data that is present in a cohort report. In a cohort report, this dateRange is extended by the granularity and offset present in the cohortsRange; event data for the extended reporting date range is present in a cohort report.

In a cohort request, this dateRange is required and the dateRanges in the RunReportRequest or RunPivotReportRequest must be unspecified.

This dateRange should generally be aligned with the cohort's granularity. If CohortsRange uses daily granularity, this dateRange can be a single day. If CohortsRange uses weekly granularity, this dateRange can be aligned to a week boundary, starting at Sunday and ending Saturday. If CohortsRange uses monthly granularity, this dateRange can be aligned to a month, starting at the first and ending on the last day of the month.

.google.analytics.data.v1alpha.DateRange date_range = 3;

Parameter
Name Description
builderForValue DateRange.Builder
Returns
Type Description
Cohort.Builder

setDimension(String value)

public Cohort.Builder setDimension(String value)

Dimension used by the cohort. Required and only supports firstSessionDate.

string dimension = 2;

Parameter
Name Description
value String

The dimension to set.

Returns
Type Description
Cohort.Builder

This builder for chaining.

setDimensionBytes(ByteString value)

public Cohort.Builder setDimensionBytes(ByteString value)

Dimension used by the cohort. Required and only supports firstSessionDate.

string dimension = 2;

Parameter
Name Description
value ByteString

The bytes for dimension to set.

Returns
Type Description
Cohort.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Cohort.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Cohort.Builder
Overrides

setName(String value)

public Cohort.Builder setName(String value)

Assigns a name to this cohort. The dimension cohort is valued to this name in a report response. If set, cannot begin with cohort_ or RESERVED_. If not set, cohorts are named by their zero based index cohort_0, cohort_1, etc.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Cohort.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Cohort.Builder setNameBytes(ByteString value)

Assigns a name to this cohort. The dimension cohort is valued to this name in a report response. If set, cannot begin with cohort_ or RESERVED_. If not set, cohorts are named by their zero based index cohort_0, cohort_1, etc.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Cohort.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Cohort.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Cohort.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Cohort.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Cohort.Builder
Overrides