# Validators


```
public static class Validators
```

<br />

*** ** * ** ***

Utility class for validating model objects.

## Summary

| ### Public fields |
|---|---|
| `static @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#INSTANCE()` |

| ### Public methods |
|---|---|
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#requireNonNegative(kotlin.Double,kotlin.String)(double value, @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/lang/String.html name)` Validates that the given Double number is non-negative. |
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#requireNonNegative(kotlin.Int,kotlin.String)(int value, @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/lang/String.html name)` Validates that the given Int number is non-negative. |
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#validateAltitude(kotlin.Double)(double altitude)` Validates that the given altitude is finite. |
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#validateFinite(kotlin.Double)(double num)` Validates that the given Double number is finite. |
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#validateFinite(kotlin.Int)(int num)` Validates that the given Int number is finite. |
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#validateFinite(kotlin.Long)(long num)` Validates that the given Long number is finite. |
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#validateHeading(kotlin.Double)(double heading)` Validates that the given heading is in the range 0.0, 360.0. |
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#validateLatitude(kotlin.Double)(double latitude)` Validates that the given latitude is in the range -90.0, 90.0. |
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#validateLongitude(kotlin.Double)(double longitude)` Validates that the given longitude is in the range -180.0, 180.0. |
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#validateRange(kotlin.Double)(double range)` Validates that the given range is non-negative. |
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#validateRoll(kotlin.Double)(double roll)` Validates that the given roll is in the range -360.0, 360.0. |
| `final void` | `https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/Validators#validateTilt(kotlin.Double)(double tilt)` Validates that the given tilt is in the range -90.0, 90.0. |

## Public fields

### INSTANCE

```
public static @NonNull Validators INSTANCE
```

## Public methods

### requireNonNegative

```
public final void requireNonNegative(double value, @NonNull String name)
```

Validates that the given Double number is non-negative.

| Parameters |
|---|---|
| `double value` | The number to validate. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/lang/String.html name` | The name of the number. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the number is negative. |

### requireNonNegative

```
public final void requireNonNegative(int value, @NonNull String name)
```

Validates that the given Int number is non-negative.

| Parameters |
|---|---|
| `int value` | The number to validate. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/lang/String.html name` | The name of the number. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the number is negative. |

### validateAltitude

```
public final void validateAltitude(double altitude)
```

Validates that the given altitude is finite.

| Parameters |
|---|---|
| `double altitude` | The altitude to validate. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the altitude is not finite. |

### validateFinite

```
public final void validateFinite(double num)
```

Validates that the given Double number is finite.

| Parameters |
|---|---|
| `double num` | The number to validate. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the number is not finite. |

### validateFinite

```
public final void validateFinite(int num)
```

Validates that the given Int number is finite.

| Parameters |
|---|---|
| `int num` | The number to validate. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the number is not finite. |

### validateFinite

```
public final void validateFinite(long num)
```

Validates that the given Long number is finite.

| Parameters |
|---|---|
| `long num` | The number to validate. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the number is not finite. |

### validateHeading

```
public final void validateHeading(double heading)
```

Validates that the given heading is in the range 0.0, 360.0.

| Parameters |
|---|---|
| `double heading` | The heading to validate. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the heading is not in the range 0.0, 360.0. |

### validateLatitude

```
public final void validateLatitude(double latitude)
```

Validates that the given latitude is in the range -90.0, 90.0.

| Parameters |
|---|---|
| `double latitude` | The latitude to validate. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the latitude is not in the range -90.0, 90.0. |

### validateLongitude

```
public final void validateLongitude(double longitude)
```

Validates that the given longitude is in the range -180.0, 180.0.

| Parameters |
|---|---|
| `double longitude` | The longitude to validate. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the longitude is not in the range -180.0, 180.0. |

### validateRange

```
public final void validateRange(double range)
```

Validates that the given range is non-negative.

| Parameters |
|---|---|
| `double range` | The range to validate. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the range is negative. |

### validateRoll

```
public final void validateRoll(double roll)
```

Validates that the given roll is in the range -360.0, 360.0.

| Parameters |
|---|---|
| `double roll` | The roll to validate. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the roll is not in the range -360.0, 360.0. |

### validateTilt

```
public final void validateTilt(double tilt)
```

Validates that the given tilt is in the range -90.0, 90.0.

| Parameters |
|---|---|
| `double tilt` | The tilt to validate. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html` | If the tilt is not in the range -90.0, 90.0. |