# TimeInterval

Artifact: [androidx.wear.watchface:watchface-complications-data-source](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/complications/datasource/ComplicationDataTimeline.kt+class:androidx.wear.watchface.complications.datasource.TimeInterval) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0)

*** ** * ** ***

<br />

```
public final class TimeInterval
```

<br />

*** ** * ** ***

A time interval, typically used to describe the validity period of a `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimelineEntry`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#TimeInterval(java.time.Instant,java.time.Instant)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html start, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html end)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#getEnd()()` The `https://developer.android.com/reference/java/time/Instant.html` when this TimeInterval becomes invalid, must be after `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#start()` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#getStart()()` The `https://developer.android.com/reference/java/time/Instant.html` when this TimeInterval becomes valid |
| `int` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#hashCode()()` |
| `final void` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#setEnd(java.time.Instant)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html value)` |
| `final void` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#setStart(java.time.Instant)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html value)` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#toString()()` |

## Public constructors

### TimeInterval

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0)

```
public TimeInterval(@NonNull Instant start, @NonNull Instant end)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html start` | The `https://developer.android.com/reference/java/time/Instant.html` when this TimeInterval becomes valid |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html end` | The `https://developer.android.com/reference/java/time/Instant.html` when this TimeInterval becomes invalid, must be after `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#start()` |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getEnd

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0)

```
public final @NonNull Instant getEnd()
```

The `https://developer.android.com/reference/java/time/Instant.html` when this TimeInterval becomes invalid, must be after `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#start()`

### getStart

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0)

```
public final @NonNull Instant getStart()
```

The `https://developer.android.com/reference/java/time/Instant.html` when this TimeInterval becomes valid

### hashCode

```
public int hashCode()
```

### setEnd

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0)

```
public final void setEnd(@NonNull Instant value)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html value` | The `https://developer.android.com/reference/java/time/Instant.html` when this TimeInterval becomes invalid, must be after `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimeInterval#start()` |

### setStart

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0)

```
public final void setStart(@NonNull Instant value)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html value` | The `https://developer.android.com/reference/java/time/Instant.html` when this TimeInterval becomes valid |

### toString

```
public @NonNull String toString()
```