# Enum DoorState

java.lang.Object
java.lang.Enum<DoorState>
com.codename1.home.DoorState

All Implemented Interfaces:
  `Comparable<DoorState>`

public enum DoorState extends Enum<DoorState>

The state of a door or garage door, for `Trait.DOOR_STATE` and `Trait.TARGET_DOOR_STATE`.

##### Backend support

HomeKit publishes this directly. The Google Home APIs have an equivalent through Google's own garage-door trait. Matter has no standard garage cluster in the revisions shipping ecosystems support, so an Android build running on Play services Matter commissioning alone -- see `HomeAvailability.COMMISSIONING_ONLY` -- cannot see a garage door at all.

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `CLOSED`
  Fully closed.
  `CLOSING`
  Moving toward `CLOSED`.
  `OPEN`
  Fully open.
  `OPENING`
  Moving toward `OPEN`.
  `STOPPED`
  Halted part-way, usually because the user stopped it or an obstruction was hit.
  `UNKNOWN`
  The accessory could not say.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isWritable()`
  Whether this state may be written to `Trait.TARGET_DOOR_STATE`.
  `static DoorState`
  `of(TraitValue value)`
  Reads a door state out of a trait value, total: a value that is not an enum, or whose ordinal is outside this set, answers `UNKNOWN`.
  `static DoorState`
  `valueOf(String name)`
  Returns the enum constant of this type with the specified name.
  `static DoorState[]`
  `values()`
  Returns an array containing the constants of this enum type, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf`

  ### Methods inherited from class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### OPEN

    public static final DoorState OPEN
    Fully open.

  - ### CLOSED

    public static final DoorState CLOSED
    Fully closed.

  - ### OPENING

    public static final DoorState OPENING
    Moving toward `OPEN`. A report only; not writable.

  - ### CLOSING

    public static final DoorState CLOSING
    Moving toward `CLOSED`. A report only; not writable.

  - ### STOPPED

    public static final DoorState STOPPED
    Halted part-way, usually because the user stopped it or an obstruction was hit. Check `Trait.OBSTRUCTION_DETECTED`. A report only.

  - ### UNKNOWN

    public static final DoorState UNKNOWN
    The accessory could not say.

- ## Method Details

  - ### values

    public static DoorState[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static DoorState 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.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### of

    public static DoorState of(TraitValue value)

    Reads a door state out of a trait value, total: a value that is not an enum, or whose ordinal is outside this set, answers `UNKNOWN`.

    ###### Parameters

    - `value`: a value read from `Trait.DOOR_STATE` or `Trait.TARGET_DOOR_STATE`, or `null`

    ###### Returns

    the state, never `null`

  - ### isWritable

    public boolean isWritable()

    Whether this state may be written to `Trait.TARGET_DOOR_STATE`.

    ###### Returns

    `true` for `OPEN` and `CLOSED` only