]> git.basschouten.com Git - openhab-addons.git/blob
4f3849ec4f1ed99ac4a1e3b2b6a8831f1e5e67f7
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.amplipi.internal.model;
14
15 /**
16  * An enumeration.
17  */
18 public enum StreamCommand {
19   
20   PLAY("play"),
21   
22   PAUSE("pause"),
23   
24   NEXT("next"),
25   
26   STOP("stop"),
27   
28   LIKE("like"),
29   
30   BAN("ban"),
31   
32   SHELVE("shelve");
33
34   private String value;
35
36   StreamCommand(String value) {
37     this.value = value;
38   }
39
40   @Override
41   public String toString() {
42     return String.valueOf(value);
43   }
44
45   public static StreamCommand fromValue(String value) {
46     for (StreamCommand b : StreamCommand.values()) {
47       if (b.value.equals(value)) {
48         return b;
49       }
50     }
51     throw new IllegalArgumentException("Unexpected value '" + value + "'");
52   }
53   
54 }
55