1 //Create a class for location variable
5 private int contactBookEnabled
10 private List phoneNumbers
13 private Phrase helloHome
15 LocationVar(Closure sendEvent) {
16 this.modes = [[name: "home"],[name: "away"],[name: "night"]]
18 this.helloHome = new Phrase()
19 this.contactBookEnabled = 1
20 this.contacts = ['AJ']
21 this.phoneNumbers = [9495379373]
22 this.sendEvent = sendEvent
23 this.timeZone = TimeZone.getTimeZone("America/New_York")
27 def setValue(LinkedHashMap eventDataMap) {
28 def sentMode = eventDataMap['value']
29 println("The location is changed to $sentMode!")
31 sendEvent(eventDataMap)