code: @Override
      public void setValue(Boolean value, boolean fireEvents) {
          boolean oldValue = getValue();
          if (value) {
              input.getElement().setAttribute("checked", "true");
          } else {
              input.getElement().removeAttribute("checked");
          }
  
          if (fireEvents && oldValue != value) {
              ValueChangeEvent.fire(this, getValue());
          }
      }
docs: Set the value of switch component.