2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.hue.internal.dto;
15 import java.util.Date;
18 * Collection of updates to a schedule.
20 * @author Q42 - Initial contribution
21 * @author Denis Dudnik - moved Jue library source code inside the smarthome Hue binding, minor code cleanup
22 * @author Samuel Leisering - refactor configuration updates
24 public class ScheduleUpdate extends ConfigUpdate {
27 * Set the name of the schedule.
29 * @param name new name
30 * @return this object for chaining calls
32 public ScheduleUpdate setName(String name) {
33 if (Util.stringSize(name) > 32) {
34 throw new IllegalArgumentException("Schedule name can be at most 32 characters long");
37 commands.add(new Command("name", name));
42 * Set the description of the schedule.
44 * @param description new description
45 * @return this object for chaining calls
47 public ScheduleUpdate setDescription(String description) {
48 if (Util.stringSize(description) > 64) {
49 throw new IllegalArgumentException("Schedule description can be at most 64 characters long");
52 commands.add(new Command("description", description));
57 * Set the time of the schedule.
59 * @param time new time
60 * @return this object for chaining calls
62 public ScheduleUpdate setTime(Date time) {
63 commands.add(new Command("time", time));