Class Cohort (0.30.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
TypeDescription
int

DIMENSION_FIELD_NUMBER

public static final int DIMENSION_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Cohort getDefaultInstance()
Returns
TypeDescription
Cohort

getDescriptor()

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

newBuilder()

public static Cohort.Builder newBuilder()
Returns
TypeDescription
Cohort.Builder

newBuilder(Cohort prototype)

public static Cohort.Builder newBuilder(Cohort prototype)
Parameter
NameDescription
prototypeCohort
Returns
TypeDescription
Cohort.Builder

parseDelimitedFrom(InputStream input)

public static Cohort parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Cohort parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Cohort parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Cohort parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Cohort parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Cohort parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Cohort parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Cohort parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Cohort parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Cohort parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Cohort parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Cohort parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Cohort
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Cohort> parser()
Returns
TypeDescription
Parser<Cohort>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
DateRangeOrBuilder

getDefaultInstanceForType()

public Cohort getDefaultInstanceForType()
Returns
TypeDescription
Cohort

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.

getParserForType()

public Parser<Cohort> getParserForType()
Returns
TypeDescription
Parser<Cohort>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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
TypeDescription
boolean

Whether the dateRange field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Cohort.Builder newBuilderForType()
Returns
TypeDescription
Cohort.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Cohort.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Cohort.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Cohort.Builder toBuilder()
Returns
TypeDescription
Cohort.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException