Class Cohort.Builder (0.51.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.v1beta.Cohort

Implements

CohortOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Cohort.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Cohort.Builder
Overrides

build()

public Cohort build()
Returns
TypeDescription
Cohort

buildPartial()

public Cohort buildPartial()
Returns
TypeDescription
Cohort

clear()

public Cohort.Builder clear()
Returns
TypeDescription
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.v1beta.DateRange date_range = 3;

Returns
TypeDescription
Cohort.Builder

clearDimension()

public Cohort.Builder clearDimension()

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

string dimension = 2;

Returns
TypeDescription
Cohort.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Cohort.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
Cohort.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Cohort.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Cohort.Builder
Overrides

clone()

public Cohort.Builder clone()
Returns
TypeDescription
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.v1beta.DateRange date_range = 3;

Returns
TypeDescription
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.v1beta.DateRange date_range = 3;

Returns
TypeDescription
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.v1beta.DateRange date_range = 3;

Returns
TypeDescription
DateRangeOrBuilder

getDefaultInstanceForType()

public Cohort getDefaultInstanceForType()
Returns
TypeDescription
Cohort

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDimension()

public String getDimension()

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

string dimension = 2;

Returns
TypeDescription
String

The dimension.

getDimensionBytes()

public ByteString getDimensionBytes()

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

string dimension = 2;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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.v1beta.DateRange date_range = 3;

Returns
TypeDescription
boolean

Whether the dateRange field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
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.v1beta.DateRange date_range = 3;

Parameter
NameDescription
valueDateRange
Returns
TypeDescription
Cohort.Builder

mergeFrom(Cohort other)

public Cohort.Builder mergeFrom(Cohort other)
Parameter
NameDescription
otherCohort
Returns
TypeDescription
Cohort.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Cohort.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Cohort.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Cohort.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Cohort.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Cohort.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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.v1beta.DateRange date_range = 3;

Parameter
NameDescription
valueDateRange
Returns
TypeDescription
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.v1beta.DateRange date_range = 3;

Parameter
NameDescription
builderForValueDateRange.Builder
Returns
TypeDescription
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
NameDescription
valueString

The dimension to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for dimension to set.

Returns
TypeDescription
Cohort.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Cohort.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The name to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Cohort.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Cohort.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Cohort.Builder
Overrides