1 //Create a class for location variable
5 private int contactBookEnabled
9 private List phoneNumbers
12 private Phrase helloHome
14 LocationVar(Closure sendEvent) {
15 this.modes = [[name: "home"],[name: "away"],[name: "night"]]
17 this.helloHome = new Phrase()
18 this.contactBookEnabled = 1
19 this.contacts = ['AJ']
20 this.phoneNumbers = [9495379373]
21 this.sendEvent = sendEvent
25 def setValue(LinkedHashMap eventDataMap) {
26 def sentMode = eventDataMap['value']
27 println("The location is changed to $sentMode!")
29 sendEvent(eventDataMap)