public final class Segment extends GeneratedMessageV3 implements SegmentOrBuilder
A segment is a subset of your Analytics data. For example, of your entire set
of users, one segment might be users from a particular country or city.
Another segment might be users who purchase a particular line of products or
who visit a specific part of your site or trigger certain events in your app.
To learn more, see GA4 Segment
Builder.
Protobuf type google.analytics.data.v1alpha.Segment
Static Fields
EVENT_SEGMENT_FIELD_NUMBER
public static final int EVENT_SEGMENT_FIELD_NUMBER
Field Value
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
Field Value
SESSION_SEGMENT_FIELD_NUMBER
public static final int SESSION_SEGMENT_FIELD_NUMBER
Field Value
USER_SEGMENT_FIELD_NUMBER
public static final int USER_SEGMENT_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static Segment getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static Segment.Builder newBuilder()
Returns
newBuilder(Segment prototype)
public static Segment.Builder newBuilder(Segment prototype)
Parameter
Returns
public static Segment parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static Segment parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static Segment parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Segment parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static Segment parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Segment parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Segment parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static Segment parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Segment parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static Segment parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static Segment parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Segment parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<Segment> parser()
Returns
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getDefaultInstanceForType()
public Segment getDefaultInstanceForType()
Returns
getEventSegment()
public EventSegment getEventSegment()
Event segments are subsets of events that were triggered on your site or
app.
.google.analytics.data.v1alpha.EventSegment event_segment = 4;
Returns
getEventSegmentOrBuilder()
public EventSegmentOrBuilder getEventSegmentOrBuilder()
Event segments are subsets of events that were triggered on your site or
app.
.google.analytics.data.v1alpha.EventSegment event_segment = 4;
Returns
getName()
The name for this segment. If unspecified, segments are named "Segment".
This name defines string value returned by the segment
dimension. The
segment
dimension prefixes segment names by the 1-based index number of
the segment in the request (i.e. "1. Segment", "2. Segment", etc.).
string name = 1;
Returns
Type | Description |
String | The name.
|
getNameBytes()
public ByteString getNameBytes()
The name for this segment. If unspecified, segments are named "Segment".
This name defines string value returned by the segment
dimension. The
segment
dimension prefixes segment names by the 1-based index number of
the segment in the request (i.e. "1. Segment", "2. Segment", etc.).
string name = 1;
Returns
getOneSegmentScopeCase()
public Segment.OneSegmentScopeCase getOneSegmentScopeCase()
Returns
getParserForType()
public Parser<Segment> getParserForType()
Returns
Overrides
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
getSessionSegment()
public SessionSegment getSessionSegment()
Session segments are subsets of the sessions that occurred on your site
or app.
.google.analytics.data.v1alpha.SessionSegment session_segment = 3;
Returns
getSessionSegmentOrBuilder()
public SessionSegmentOrBuilder getSessionSegmentOrBuilder()
Session segments are subsets of the sessions that occurred on your site
or app.
.google.analytics.data.v1alpha.SessionSegment session_segment = 3;
Returns
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
getUserSegment()
public UserSegment getUserSegment()
User segments are subsets of users who engaged with your site or app.
.google.analytics.data.v1alpha.UserSegment user_segment = 2;
Returns
getUserSegmentOrBuilder()
public UserSegmentOrBuilder getUserSegmentOrBuilder()
User segments are subsets of users who engaged with your site or app.
.google.analytics.data.v1alpha.UserSegment user_segment = 2;
Returns
hasEventSegment()
public boolean hasEventSegment()
Event segments are subsets of events that were triggered on your site or
app.
.google.analytics.data.v1alpha.EventSegment event_segment = 4;
Returns
Type | Description |
boolean | Whether the eventSegment field is set.
|
hasSessionSegment()
public boolean hasSessionSegment()
Session segments are subsets of the sessions that occurred on your site
or app.
.google.analytics.data.v1alpha.SessionSegment session_segment = 3;
Returns
Type | Description |
boolean | Whether the sessionSegment field is set.
|
hasUserSegment()
public boolean hasUserSegment()
User segments are subsets of users who engaged with your site or app.
.google.analytics.data.v1alpha.UserSegment user_segment = 2;
Returns
Type | Description |
boolean | Whether the userSegment field is set.
|
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public Segment.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Segment.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public Segment.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions