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
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
Static Fields
EVENT_SEGMENT_FIELD_NUMBER
public static final int EVENT_SEGMENT_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
SESSION_SEGMENT_FIELD_NUMBER
public static final int SESSION_SEGMENT_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
USER_SEGMENT_FIELD_NUMBER
public static final int USER_SEGMENT_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
Static Methods
getDefaultInstance()
public static Segment getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static Segment.Builder newBuilder()
newBuilder(Segment prototype)
public static Segment.Builder newBuilder(Segment prototype)
Parameter |
---|
Name | Description |
prototype | Segment
|
public static Segment parseDelimitedFrom(InputStream input)
public static Segment parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static Segment parseFrom(byte[] data)
Parameter |
---|
Name | Description |
data | byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Segment parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static Segment parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Segment parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Segment parseFrom(CodedInputStream input)
public static Segment parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static Segment parseFrom(InputStream input)
public static Segment parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static Segment parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Segment parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<Segment> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
---|
Name | Description |
obj | Object
|
Overrides
getDefaultInstanceForType()
public Segment getDefaultInstanceForType()
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;
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;
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 (for example "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 (for example "1. Segment", "2. Segment", etc.).
string name = 1;
Returns |
---|
Type | Description |
ByteString | The bytes for name.
|
getOneSegmentScopeCase()
public Segment.OneSegmentScopeCase getOneSegmentScopeCase()
getParserForType()
public Parser<Segment> getParserForType()
Overrides
getSerializedSize()
public int getSerializedSize()
Returns |
---|
Type | Description |
int | |
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;
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;
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;
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;
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 |
---|
Type | Description |
int | |
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public Segment.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Segment.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Overrides
toBuilder()
public Segment.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides