Class Cohort (0.63.0)

public final class Cohort extends GeneratedMessageV3 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 Fields

DATE_RANGE_FIELD_NUMBER

public static final int DATE_RANGE_FIELD_NUMBER
Field Value
Type Description
int

DIMENSION_FIELD_NUMBER

public static final int DIMENSION_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Cohort getDefaultInstance()
Returns
Type Description
Cohort

getDescriptor()

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

newBuilder()

public static Cohort.Builder newBuilder()
Returns
Type Description
Cohort.Builder

newBuilder(Cohort prototype)

public static Cohort.Builder newBuilder(Cohort prototype)
Parameter
Name Description
prototype Cohort
Returns
Type Description
Cohort.Builder

parseDelimitedFrom(InputStream input)

public static Cohort parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Cohort
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Cohort parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Cohort
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Cohort parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Cohort
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Cohort parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Cohort
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Cohort parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Cohort
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Cohort parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Cohort
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Cohort parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Cohort
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Cohort parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Cohort
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Cohort parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Cohort
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Cohort parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Cohort
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Cohort parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Cohort
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Cohort parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Cohort
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Cohort> parser()
Returns
Type Description
Parser<Cohort>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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
Type Description
DateRange

The dateRange.

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
Type Description
DateRangeOrBuilder

getDefaultInstanceForType()

public Cohort getDefaultInstanceForType()
Returns
Type Description
Cohort

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.

getParserForType()

public Parser<Cohort> getParserForType()
Returns
Type Description
Parser<Cohort>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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
Type Description
boolean

Whether the dateRange field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Cohort.Builder newBuilderForType()
Returns
Type Description
Cohort.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Cohort.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Cohort.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Cohort.Builder toBuilder()
Returns
Type Description
Cohort.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException