Hasmap items

is it possible to use a hashmap to link items to eachother?

My use case – I want to reference my wall switch item with the relays it should control. So two use cases:

  1. single item mapped to another item
  2. single item mapped to multiple items

Any help on syntax would be great.

nevermind, it worked with my code snippet below:

val nodesKillSwitch = newHashMap( 
  "NODE_HB_JakesBedroom" -> NODE_DMS_JakesBedroom, 
  "NODE_HB_NataliesBedroom"  -> NODE_DMS_NataliesBedroom
)


rule "NodeReset" 
when 
Time cron "0 0 9 * * ?" 
then
	gNodeHB.members.forEach [ Node|
   		
		// check if HB is reporting over 20 hours, if so, send reboot command
		if (Node.state > 20) {
			logWarn("ashburn.Nodes", "#### node reset hashmap lookup: "+Node.name+" = " + nodesKillSwitch.get(Node.name))
			sendCommand(nodesKillSwitch.get(Node.name), ON) 
			Thread::sleep(3000)
			sendCommand(nodesKillSwitch.get(Node.name), OFF)
		}

	]
	
end