# Class HomeZone

java.lang.Object
com.codename1.home.HomeZone

public final class HomeZone extends Object

A named grouping of rooms -- "upstairs", "the annexe": HomeKit's `HMZone`.

HomeKit only. No other backend has the concept, and `HomeStructure.getZones()` returns an empty list on them rather than synthesizing groupings out of room names. A guess about which rooms a user thinks of as upstairs is not information, and an app that laid out its navigation around invented zones would look broken on the platform that has real ones.

An immutable snapshot.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HomeZone(String id, String name, List<String> roomIds)`
  Creates a zone snapshot.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getId()`
  The identifier this zone is addressed by.
  `String`
  `getName()`
  The user-visible name, empty when the zone has none.
  `List<String>`
  `getRoomIds()`
  The rooms in this zone.
  `String`
  `toString()`
  Returns a string representation of the object.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### HomeZone

    public HomeZone(String id, String name, List<String> roomIds)

    Creates a zone snapshot. Called by the iOS port.

    ###### Parameters

    - `id`: the zone identifier

    - `name`: the user-visible name, or `null` for none

    - `roomIds`: the rooms in this zone; `null` becomes empty

    ###### Throws

    - `IllegalArgumentException`: when `id` is `null` or empty

- ## Method Details

  - ### getId

    public String getId()

    The identifier this zone is addressed by.

    ###### Returns

    the identifier, never `null`

  - ### getName

    public String getName()

    The user-visible name, empty when the zone has none.

    ###### Returns

    the name, never `null`

  - ### getRoomIds

    public List<String> getRoomIds()

    The rooms in this zone.

    ###### Returns

    an immutable list of room identifiers, possibly empty

  - ### toString

    public String toString()
    Description copied from class: `Object`
    Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
    Overrides:
      `toString` in class `Object`