Class CohortSpec.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<CohortSpec.Builder>
com.google.analytics.data.v1alpha.CohortSpec.Builder
All Implemented Interfaces:
CohortSpecOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
CohortSpec

public static final class CohortSpec.Builder extends com.google.protobuf.GeneratedMessage.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](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#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.v1alpha.CohortSpec
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<CohortSpec.Builder>
    • clear

      public CohortSpec.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<CohortSpec.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<CohortSpec.Builder>
    • getDefaultInstanceForType

      public CohortSpec getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public CohortSpec build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public CohortSpec buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public CohortSpec.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<CohortSpec.Builder>
    • mergeFrom

      public CohortSpec.Builder mergeFrom(CohortSpec other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<CohortSpec.Builder>
    • mergeFrom

      public CohortSpec.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<CohortSpec.Builder>
      Throws:
      IOException
    • 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.v1alpha.Cohort cohorts = 1;
      Specified by:
      getCohortsList in interface CohortSpecOrBuilder
    • 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.v1alpha.Cohort cohorts = 1;
      Specified by:
      getCohortsCount in interface CohortSpecOrBuilder
    • getCohorts

      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.v1alpha.Cohort cohorts = 1;
      Specified by:
      getCohorts in interface CohortSpecOrBuilder
    • setCohorts

      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.v1alpha.Cohort cohorts = 1;
    • setCohorts

      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.v1alpha.Cohort cohorts = 1;
    • addCohorts

      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.v1alpha.Cohort cohorts = 1;
    • addCohorts

      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.v1alpha.Cohort cohorts = 1;
    • addCohorts

      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.v1alpha.Cohort cohorts = 1;
    • addCohorts

      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.v1alpha.Cohort cohorts = 1;
    • addAllCohorts

      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.v1alpha.Cohort cohorts = 1;
    • 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.v1alpha.Cohort cohorts = 1;
    • removeCohorts

      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.v1alpha.Cohort cohorts = 1;
    • getCohortsBuilder

      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.v1alpha.Cohort cohorts = 1;
    • getCohortsOrBuilder

      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.v1alpha.Cohort cohorts = 1;
      Specified by:
      getCohortsOrBuilder in interface CohortSpecOrBuilder
    • 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.v1alpha.Cohort cohorts = 1;
      Specified by:
      getCohortsOrBuilderList in interface CohortSpecOrBuilder
    • 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.v1alpha.Cohort cohorts = 1;
    • addCohortsBuilder

      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.v1alpha.Cohort cohorts = 1;
    • 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.v1alpha.Cohort cohorts = 1;
    • 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.v1alpha.CohortsRange cohorts_range = 2;
      Specified by:
      hasCohortsRange in interface CohortSpecOrBuilder
      Returns:
      Whether the cohortsRange field is set.
    • 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.v1alpha.CohortsRange cohorts_range = 2;
      Specified by:
      getCohortsRange in interface CohortSpecOrBuilder
      Returns:
      The cohortsRange.
    • setCohortsRange

      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.v1alpha.CohortsRange cohorts_range = 2;
    • setCohortsRange

      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.v1alpha.CohortsRange cohorts_range = 2;
    • mergeCohortsRange

      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.v1alpha.CohortsRange cohorts_range = 2;
    • 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.v1alpha.CohortsRange cohorts_range = 2;
    • 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.v1alpha.CohortsRange cohorts_range = 2;
    • 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.v1alpha.CohortsRange cohorts_range = 2;
      Specified by:
      getCohortsRangeOrBuilder in interface CohortSpecOrBuilder
    • hasCohortReportSettings

      public boolean hasCohortReportSettings()
       Optional settings for a cohort report.
       
      .google.analytics.data.v1alpha.CohortReportSettings cohort_report_settings = 3;
      Specified by:
      hasCohortReportSettings in interface CohortSpecOrBuilder
      Returns:
      Whether the cohortReportSettings field is set.
    • getCohortReportSettings

      public CohortReportSettings getCohortReportSettings()
       Optional settings for a cohort report.
       
      .google.analytics.data.v1alpha.CohortReportSettings cohort_report_settings = 3;
      Specified by:
      getCohortReportSettings in interface CohortSpecOrBuilder
      Returns:
      The cohortReportSettings.
    • setCohortReportSettings

      public CohortSpec.Builder setCohortReportSettings(CohortReportSettings value)
       Optional settings for a cohort report.
       
      .google.analytics.data.v1alpha.CohortReportSettings cohort_report_settings = 3;
    • setCohortReportSettings

      public CohortSpec.Builder setCohortReportSettings(CohortReportSettings.Builder builderForValue)
       Optional settings for a cohort report.
       
      .google.analytics.data.v1alpha.CohortReportSettings cohort_report_settings = 3;
    • mergeCohortReportSettings

      public CohortSpec.Builder mergeCohortReportSettings(CohortReportSettings value)
       Optional settings for a cohort report.
       
      .google.analytics.data.v1alpha.CohortReportSettings cohort_report_settings = 3;
    • clearCohortReportSettings

      public CohortSpec.Builder clearCohortReportSettings()
       Optional settings for a cohort report.
       
      .google.analytics.data.v1alpha.CohortReportSettings cohort_report_settings = 3;
    • getCohortReportSettingsBuilder

      public CohortReportSettings.Builder getCohortReportSettingsBuilder()
       Optional settings for a cohort report.
       
      .google.analytics.data.v1alpha.CohortReportSettings cohort_report_settings = 3;
    • getCohortReportSettingsOrBuilder

      public CohortReportSettingsOrBuilder getCohortReportSettingsOrBuilder()
       Optional settings for a cohort report.
       
      .google.analytics.data.v1alpha.CohortReportSettings cohort_report_settings = 3;
      Specified by:
      getCohortReportSettingsOrBuilder in interface CohortSpecOrBuilder