public final class HomeZone
- Object
- HomeZone
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.
Constructors
public HomeZone(String id, String name, List<String> roomIds) | Creates a zone snapshot. |
Methods
public String getId() | The identifier this zone is addressed by. |
public String getName() | The user-visible name, empty when the zone has none. |
public List<String> getRoomIds() | The rooms in this zone. |
public String toString() | Returns a string representation of the object. |
Inherited methods
Constructor details
HomeZone
public HomeZone(String id, String name, List<String> roomIds)Creates a zone snapshot. Called by the iOS port.
Parameters
idString- the zone identifier
nameString- the user-visible name, or
nullfor none roomIdsList<String>- the rooms in this zone;
nullbecomes empty
Throws
IllegalArgumentException- when
idisnullor empty
Method details
getId
public String getId()The identifier this zone is addressed by.
Returns
the identifier, never
nullgetName
public String getName()The user-visible name, empty when the zone has none.
Returns
the name, never
nullgetRoomIds
public List<String> getRoomIds()The rooms in this zone.
Returns
an immutable list of room identifiers, possibly empty
toString
public String toString()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())