Package org.openhab.io.rest.internal.resources.beans

Examples of org.openhab.io.rest.internal.resources.beans.MappingBean


        }
    }
      if(widget instanceof Switch) {
        Switch switchWidget = (Switch) widget;
        for(Mapping mapping : switchWidget.getMappings()) {
          MappingBean mappingBean = new MappingBean();
        // Remove quotes - if they exist
        if(mapping.getCmd() != null) {
          if(mapping.getCmd().startsWith("\"") && mapping.getCmd().endsWith("\"")) {
            mappingBean.command = mapping.getCmd().substring(1, mapping.getCmd().length()-1);
          }
          else {
            mappingBean.command = mapping.getCmd();
          }
        }
        else {
          mappingBean.command = mapping.getCmd();
        }
        mappingBean.label = mapping.getLabel();
        bean.mappings.add(mappingBean);
      }
    }
    if (widget instanceof Selection) {
      Selection selectionWidget = (Selection) widget;
      for (Mapping mapping : selectionWidget.getMappings()) {
        MappingBean mappingBean = new MappingBean();
        // Remove quotes - if they exist
        if(mapping.getCmd() != null) {
          if(mapping.getCmd().startsWith("\"") && mapping.getCmd().endsWith("\"")) {
            mappingBean.command = mapping.getCmd().substring(1, mapping.getCmd().length()-1);
          }
View Full Code Here

TOP

Related Classes of org.openhab.io.rest.internal.resources.beans.MappingBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.