1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package example.localservice;
16
17 import org.fourthline.cling.binding.annotations.*;
18
19 @UpnpService(
20 serviceId = @UpnpServiceId("MyService"),
21 serviceType = @UpnpServiceType(namespace = "mydomain", value = "MyService"),
22 stringConvertibleTypes = MyStringConvertible.class
23 )
24 public class MyServiceWithEnum {
25
26 public enum Color {
27 Red,
28 Green,
29 Blue
30 }
31
32 @UpnpStateVariable
33 private Color color;
34
35 @UpnpAction(out = @UpnpOutputArgument(name = "Out"))
36 public Color getColor() {
37 return color;
38 }
39
40 @UpnpAction
41 public void setColor(@UpnpInputArgument(name = "In") String color) {
42 this.color = Color.valueOf(color);
43 }
44
45 }