# Chain

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/dsl/Chain.java+class:androidx.constraintlayout.core.dsl.Chain) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

*** ** * ** ***


```
abstract class Chain : Helper
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.constraintlayout.core.dsl.Helper](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper) ||
|   | ↳ | [androidx.constraintlayout.core.dsl.Chain](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain) |

Known direct subclasses [HChain](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/HChain), [VChain](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/VChain)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/HChain` |   |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/VChain` |   |

*** ** * ** ***

## Summary

| ### Nested types |
|---|
| `inner class https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain.Anchor` |
| `enum https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain.Style` |

| ### Constants |
|---|---|
| `const (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain.Style!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain#styleMap()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain#Chain(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain#addReference(androidx.constraintlayout.core.dsl.Ref)(ref: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Ref!)` Add a new reference |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain#addReference(java.lang.String)(ref: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Add a new reference |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain.Style!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain#getStyle()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain#referencesToString()()` convert references to a String representation |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain#setStyle(androidx.constraintlayout.core.dsl.Chain.Style)(style: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain.Style!)` |

| ### Protected properties |
|---|---|
| `https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Ref!>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain#references()` |

| ### Inherited Constants |
|---|
| From [androidx.constraintlayout.core.dsl.Helper](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper) |---|---| | `const (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Constraint.Side!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#sideMap()` | | `const (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper.Type!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#typeMap()` | |

| ### Inherited functions |
|---|
| From [androidx.constraintlayout.core.dsl.Helper](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#append(java.util.Map<java.lang.String,java.lang.String>,java.lang.StringBuilder)(map: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!, ret: https://developer.android.com/reference/java/lang/StringBuilder.html!)` | | `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#convertConfigToMap()()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#getConfig()()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#getId()()` | | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper.HelperType!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#getType()()` | | `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#main(java.lang.String[])(args: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#toString()()` | |

| ### Inherited properties |
|---|
| From [androidx.constraintlayout.core.dsl.Helper](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#config()` | | `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#configMap()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#name()` | | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper.HelperType!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Helper#type()` | |

## Constants

### styleMap

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
protected const val styleMap: (Mutable)Map<Chain.Style!, String!>!
```

## Public constructors

### Chain

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
Chain(name: String!)
```

## Public functions

### addReference

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
fun addReference(ref: Ref!): Chain!
```

Add a new reference

| Parameters |
|---|---|
| `ref: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Ref!` | reference |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain!` | Chain |

### addReference

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
fun addReference(ref: String!): Chain!
```

Add a new reference

| Parameters |
|---|---|
| `ref: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | reference in a String representation |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Chain!` | Chain |

### getStyle

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
fun getStyle(): Chain.Style!
```

### referencesToString

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
fun referencesToString(): String!
```

convert references to a String representation

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | a String representation of references |

### setStyle

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
fun setStyle(style: Chain.Style!): Unit
```

## Protected properties

### references

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
protected val references: ArrayList<Ref!>!
```