Class CohortSpec.Builder (0.38.0)

public static final class CohortSpec.Builder extends GeneratedMessageV3.Builder<CohortSpec.Builder> implements CohortSpecOrBuilder

The specification of cohorts for a cohort report.

Cohort reports create a time series of user retention for the cohort. For example, you could select the cohort of users that were acquired in the first week of September and follow that cohort for the next six weeks. Selecting the users acquired in the first week of September cohort is specified in the cohort object. Following that cohort for the next six weeks is specified in the cohortsRange object.

For examples, see Cohort Report Examples.

The report response could show a weekly time series where say your app has retained 60% of this cohort after three weeks and 25% of this cohort after six weeks. These two percentages can be calculated by the metric cohortActiveUsers/cohortTotalUsers and will be separate rows in the report.

Protobuf type google.analytics.data.v1beta.CohortSpec

Implements

CohortSpecOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllCohorts(Iterable<? extends Cohort> values)

public CohortSpec.Builder addAllCohorts(Iterable<? extends Cohort> values)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
NameDescription
valuesIterable<? extends com.google.analytics.data.v1beta.Cohort>
Returns
TypeDescription
CohortSpec.Builder

addCohorts(Cohort value)

public CohortSpec.Builder addCohorts(Cohort value)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
NameDescription
valueCohort
Returns
TypeDescription
CohortSpec.Builder

addCohorts(Cohort.Builder builderForValue)

public CohortSpec.Builder addCohorts(Cohort.Builder builderForValue)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
NameDescription
builderForValueCohort.Builder
Returns
TypeDescription
CohortSpec.Builder

addCohorts(int index, Cohort value)

public CohortSpec.Builder addCohorts(int index, Cohort value)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameters
NameDescription
indexint
valueCohort
Returns
TypeDescription
CohortSpec.Builder

addCohorts(int index, Cohort.Builder builderForValue)

public CohortSpec.Builder addCohorts(int index, Cohort.Builder builderForValue)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameters
NameDescription
indexint
builderForValueCohort.Builder
Returns
TypeDescription
CohortSpec.Builder

addCohortsBuilder()

public Cohort.Builder addCohortsBuilder()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
TypeDescription
Cohort.Builder

addCohortsBuilder(int index)

public Cohort.Builder addCohortsBuilder(int index)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
Cohort.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public CohortSpec build()
Returns
TypeDescription
CohortSpec

buildPartial()

public CohortSpec buildPartial()
Returns
TypeDescription
CohortSpec

clear()

public CohortSpec.Builder clear()
Returns
TypeDescription
CohortSpec.Builder
Overrides

clearCohortReportSettings()

public CohortSpec.Builder clearCohortReportSettings()

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Returns
TypeDescription
CohortSpec.Builder

clearCohorts()

public CohortSpec.Builder clearCohorts()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
TypeDescription
CohortSpec.Builder

clearCohortsRange()

public CohortSpec.Builder clearCohortsRange()

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Returns
TypeDescription
CohortSpec.Builder

clearField(Descriptors.FieldDescriptor field)

public CohortSpec.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
CohortSpec.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

public CohortSpec.Builder clone()
Returns
TypeDescription
CohortSpec.Builder
Overrides

getCohortReportSettings()

public CohortReportSettings getCohortReportSettings()

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Returns
TypeDescription
CohortReportSettings

The cohortReportSettings.

getCohortReportSettingsBuilder()

public CohortReportSettings.Builder getCohortReportSettingsBuilder()

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Returns
TypeDescription
CohortReportSettings.Builder

getCohortReportSettingsOrBuilder()

public CohortReportSettingsOrBuilder getCohortReportSettingsOrBuilder()

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Returns
TypeDescription
CohortReportSettingsOrBuilder

getCohorts(int index)

public Cohort getCohorts(int index)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
Cohort

getCohortsBuilder(int index)

public Cohort.Builder getCohortsBuilder(int index)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
Cohort.Builder

getCohortsBuilderList()

public List<Cohort.Builder> getCohortsBuilderList()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
TypeDescription
List<Builder>

getCohortsCount()

public int getCohortsCount()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
TypeDescription
int

getCohortsList()

public List<Cohort> getCohortsList()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
TypeDescription
List<Cohort>

getCohortsOrBuilder(int index)

public CohortOrBuilder getCohortsOrBuilder(int index)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
CohortOrBuilder

getCohortsOrBuilderList()

public List<? extends CohortOrBuilder> getCohortsOrBuilderList()

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Returns
TypeDescription
List<? extends com.google.analytics.data.v1beta.CohortOrBuilder>

getCohortsRange()

public CohortsRange getCohortsRange()

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Returns
TypeDescription
CohortsRange

The cohortsRange.

getCohortsRangeBuilder()

public CohortsRange.Builder getCohortsRangeBuilder()

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Returns
TypeDescription
CohortsRange.Builder

getCohortsRangeOrBuilder()

public CohortsRangeOrBuilder getCohortsRangeOrBuilder()

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Returns
TypeDescription
CohortsRangeOrBuilder

getDefaultInstanceForType()

public CohortSpec getDefaultInstanceForType()
Returns
TypeDescription
CohortSpec

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

hasCohortReportSettings()

public boolean hasCohortReportSettings()

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Returns
TypeDescription
boolean

Whether the cohortReportSettings field is set.

hasCohortsRange()

public boolean hasCohortsRange()

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Returns
TypeDescription
boolean

Whether the cohortsRange field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeCohortReportSettings(CohortReportSettings value)

public CohortSpec.Builder mergeCohortReportSettings(CohortReportSettings value)

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Parameter
NameDescription
valueCohortReportSettings
Returns
TypeDescription
CohortSpec.Builder

mergeCohortsRange(CohortsRange value)

public CohortSpec.Builder mergeCohortsRange(CohortsRange value)

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Parameter
NameDescription
valueCohortsRange
Returns
TypeDescription
CohortSpec.Builder

mergeFrom(CohortSpec other)

public CohortSpec.Builder mergeFrom(CohortSpec other)
Parameter
NameDescription
otherCohortSpec
Returns
TypeDescription
CohortSpec.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CohortSpec.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CohortSpec.Builder
Overrides

removeCohorts(int index)

public CohortSpec.Builder removeCohorts(int index)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
CohortSpec.Builder

setCohortReportSettings(CohortReportSettings value)

public CohortSpec.Builder setCohortReportSettings(CohortReportSettings value)

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Parameter
NameDescription
valueCohortReportSettings
Returns
TypeDescription
CohortSpec.Builder

setCohortReportSettings(CohortReportSettings.Builder builderForValue)

public CohortSpec.Builder setCohortReportSettings(CohortReportSettings.Builder builderForValue)

Optional settings for a cohort report.

.google.analytics.data.v1beta.CohortReportSettings cohort_report_settings = 3;

Parameter
NameDescription
builderForValueCohortReportSettings.Builder
Returns
TypeDescription
CohortSpec.Builder

setCohorts(int index, Cohort value)

public CohortSpec.Builder setCohorts(int index, Cohort value)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameters
NameDescription
indexint
valueCohort
Returns
TypeDescription
CohortSpec.Builder

setCohorts(int index, Cohort.Builder builderForValue)

public CohortSpec.Builder setCohorts(int index, Cohort.Builder builderForValue)

Defines the selection criteria to group users into cohorts.

Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.

repeated .google.analytics.data.v1beta.Cohort cohorts = 1;

Parameters
NameDescription
indexint
builderForValueCohort.Builder
Returns
TypeDescription
CohortSpec.Builder

setCohortsRange(CohortsRange value)

public CohortSpec.Builder setCohortsRange(CohortsRange value)

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Parameter
NameDescription
valueCohortsRange
Returns
TypeDescription
CohortSpec.Builder

setCohortsRange(CohortsRange.Builder builderForValue)

public CohortSpec.Builder setCohortsRange(CohortsRange.Builder builderForValue)

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

.google.analytics.data.v1beta.CohortsRange cohorts_range = 2;

Parameter
NameDescription
builderForValueCohortsRange.Builder
Returns
TypeDescription
CohortSpec.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

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

public CohortSpec.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
CohortSpec.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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