> For the complete documentation index, see [llms.txt](https://docs.sentiance.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sentiance.com/sdk/api-reference/android/usercontext/segment.md).

# Segment

Represents a segment that was detected for the user.

## Segment API

### `getAttributes()`

> ```java
> List<Attribute> getAttributes()
> ```
>
> Returns attributes pertaining to the segment.

### `getCategory()`

> ```java
> SegmentCategory getCategory()
> ```
>
> Returns the [category](/sdk/api-reference/android/usercontext/segment/segmentcategory.md) of the segment.

### `getEndTime()`

> ```java
> @Nullable DateTime getEndTime()
> ```
>
> Returns the end time of the segment, if it has ended. Otherwise, returns null.

### `getSegmentId()`

> ```java
> int getSegmentId()
> ```
>
> Returns the unique ID of this segment.

### `getStartTime()`

> ```java
> DateTime getStartTime()
> ```
>
> Returns the start time of the segment.

### `getSubcategory()`

> ```java
> SegmentSubcategory getSubcategory()
> ```
>
> Returns the [subcategory](/sdk/api-reference/android/usercontext/segment/segmentsubcategory.md) of the segment.

### `getType()`

> ```java
> SegmentType getType()
> ```
>
> Returns the [type](/sdk/api-reference/android/usercontext/segment/segmenttype.md) of the segment.
