«
Rule languages supports extensions to StringType
java_import org.openhab.core.library.types.StringType
logger.info("StringType inspected: #{StringType.new('my_string').inspect}")
java_import org.openhab.core.library.types.StringType
logger.info("StringType printed: #{StringType.new('my_string')}")
java_import org.openhab.core.library.types.StringType
case StringType.new("hi")
when /hi/ then logger.info("matched")
else
logger.info("did not match")
end
java_import org.openhab.core.library.types.StringType
if StringType.new("hi") =~ /hi/
logger.info("matched")
else
logger.info("did not match")
end