# SolverVariable.Type

Artifact: [androidx.constraintlayout:constraintlayout-core](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/core/SolverVariable.java+class:androidx.constraintlayout.core.SolverVariable.Type) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

*** ** * ** ***


```
public enum SolverVariable.Type
```

<br />

*** ** * ** ***

Type of variables

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/SolverVariable.Type#CONSTANT` | The variable is actually not a variable :) , but a constant number |
| `https://developer.android.com/reference/androidx/constraintlayout/core/SolverVariable.Type#ERROR` | The variable is restricted to positive values and represents an error |
| `https://developer.android.com/reference/androidx/constraintlayout/core/SolverVariable.Type#SLACK` | The variable is restricted to positive values and represents a slack |
| `https://developer.android.com/reference/androidx/constraintlayout/core/SolverVariable.Type#UNKNOWN` | Unknown (invalid) type. |
| `https://developer.android.com/reference/androidx/constraintlayout/core/SolverVariable.Type#UNRESTRICTED` | The variable can take negative or positive values |

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/constraintlayout/core/SolverVariable.Type` | `https://developer.android.com/reference/androidx/constraintlayout/core/SolverVariable.Type#valueOf(java.lang.String)(https://developer.android.com/reference/java/lang/String.html name)` Returns the enum constant of this type with the specified name. |
| `static SolverVariable.Type[]` | `https://developer.android.com/reference/androidx/constraintlayout/core/SolverVariable.Type#values()()` Returns an array containing the constants of this enum type, in the order they're declared. |

## Enum Values

### CONSTANT

```
SolverVariable.Type SolverVariable.Type.CONSTANT
```

The variable is actually not a variable :) , but a constant number

### ERROR

```
SolverVariable.Type SolverVariable.Type.ERROR
```

The variable is restricted to positive values and represents an error

### SLACK

```
SolverVariable.Type SolverVariable.Type.SLACK
```

The variable is restricted to positive values and represents a slack

### UNKNOWN

```
SolverVariable.Type SolverVariable.Type.UNKNOWN
```

Unknown (invalid) type.

### UNRESTRICTED

```
SolverVariable.Type SolverVariable.Type.UNRESTRICTED
```

The variable can take negative or positive values

## Public methods

### valueOf

Added in 1.1.2

```
public static SolverVariable.Type valueOf(String name)
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/SolverVariable.Type` | the enum constant with the specified name |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if this enum type has no constant with the specified name |

### values

Added in 1.1.2

```
public static SolverVariable.Type[] values()
```

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.

| Returns |
|---|---|
| `SolverVariable.Type[]` | an array containing the constants of this enum type, in the order they're declared |