Maps the {@code io.motown.vas.viewmodel.model.ChargeMode} to a ChargingMode. If chargeMode is null, 'unspecified' will
be returned.

@param chargeMode charge mode.
@return charging mode (ChargingMode.UNSPECIFIED is chargeMode is null).
963139
public ChargingMode getVasChargingMode(ChargeMode chargeMode) {
        return chargeMode == null ? ChargingMode.UNSPECIFIED : ChargingMode.fromValue(chargeMode.value());
    }
347460
public void setEditMode(EditMode currentMode) {
		super.setEditMode(currentMode);
		if (controller != null) {
			controller.setEditMode(currentMode);
		}
	}
565233
def mode(self):
        """"""
        if self._resources is None:
            self.__init()
        if "mode" in self._resources:
            url = self._url + "/mode"
            return _mode.Mode(url=url,
                              securityHandler=self._securityHandler,
                              proxy_url=self._proxy_url,
                              proxy_port=self._proxy_port,
                              initialize=True)
        else:
            return None
113701
public void onBeforeSetEditorMode(final EditorMode mode) {

        EditorMode oldMode = m_editorMode;
        if ((oldMode == EditorMode.categories) && ((mode == EditorMode.vfs) || (mode == EditorMode.navigation))) {
            final CmsRpcAction<Void> action = new CmsRpcAction<Void>() {

                @Override
                public void execute() {

                    start(200, true);
                    getController().refreshRoot(this);
                }

                @Override
                protected void onResponse(Void result) {

                    stop(false);
                    setEditorMode(mode);
                }
            };
            action.execute();
        } else {
            setEditorMode(mode);
        }

    }
1091965
public DrawerItem setImageMode(int imageMode) {
        if (imageMode != ICON && imageMode != AVATAR && imageMode != SMALL_AVATAR) {
            throw new IllegalArgumentException("Image mode must be either ICON or AVATAR.");
        }
        mImageMode = imageMode;
        notifyDataChanged();
        return this;
    }
519788
public void setSortMode(final SortMode sortMode) {
		getOrCreateComponentModel().sortMode = SortMode.SERVER.equals(sortMode) ? SortMode.DYNAMIC : sortMode;
	}
85310
public void setEditorModeInSession(final EditorMode editorMode) {

        CmsRpcAction<Void> action = new CmsRpcAction<Void>() {

            @Override
            public void execute() {

                getService().setEditorMode(editorMode, this);
            }

            @Override
            protected void onResponse(Void result) {

                // nothing to do

            }
        };
        action.execute();
    }
767181
public void setNightMode(boolean MODE) { 
        if (null == nightMode) {
            _nightMode = MODE;
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            nightMode.set(MODE);
        }
    }
876609
public void setSelectMode(final SelectMode selectMode) {
		switch (selectMode) {
			case MULTIPLE:
				setSelectionMode(SelectionMode.MULTIPLE);
				break;
			case SINGLE:
				setSelectionMode(SelectionMode.SINGLE);
				break;
			default:
				setSelectionMode(SelectionMode.NONE);
		}
	}
928256
public void setEditorMode(EditorMode editorMode) {

        if (editorMode != m_editorMode) {
            EditorMode oldEditorMode = m_editorMode;
            m_editorMode = editorMode;
            m_controller.setEditorModeInSession(m_editorMode);
            if (oldEditorMode == EditorMode.compareLocales) {
                // reload sitemap editor because we may need to move to a different site
                reloadForLocaleCompareRoot(m_editorMode);
                return;
            }
            switch (m_editorMode) {
                case galleries:
                    m_tree.getElement().getStyle().setDisplay(Display.NONE);
                    setGalleriesVisible(true);
                    m_toolbar.setNewGalleryEnabled(false, "");
                    setCategoriesVisible(false);
                    setModelPagesVisible(false);
                    setHeaderVisible(true);
                    m_localeComparison.setVisible(false);
                    m_toolbar.setClipboardEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_CLIPBOARD_DISABLE_0));
                    getController().loadGalleries();
                    break;
                case navigation:
                    m_tree.getElement().getStyle().clearDisplay();
                    setGalleriesVisible(false);
                    setModelPagesVisible(false);
                    setCategoriesVisible(false);
                    setHeaderVisible(true);
                    m_localeComparison.setVisible(false);
                    m_toolbar.setNewEnabled(true, null);

                    m_inNavigationStyle.setValue(I_CmsSitemapLayoutBundle.INSTANCE.sitemapItemCss().navMode());
                    break;
                case vfs:
                    m_tree.getElement().getStyle().clearDisplay();
                    setGalleriesVisible(false);
                    setCategoriesVisible(false);
                    setHeaderVisible(true);
                    m_localeComparison.setVisible(false);
                    m_toolbar.setNewEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_NEW_DISABLE_0));
                    m_toolbar.setClipboardEnabled(true, null);
                    m_inNavigationStyle.setValue(I_CmsSitemapLayoutBundle.INSTANCE.sitemapItemCss().vfsMode());
                    setModelPagesVisible(false);
                    break;
                case modelpages:
                    m_tree.getElement().getStyle().setDisplay(Display.NONE);
                    setGalleriesVisible(false);
                    setCategoriesVisible(false);
                    setModelPagesVisible(true);
                    setHeaderVisible(true);
                    m_localeComparison.setVisible(false);
                    m_toolbar.setNewEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_NEW_DISABLE_0));
                    m_toolbar.setClipboardEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_CLIPBOARD_DISABLE_0));
                    getController().loadModelPages();

                    break;
                case categories:
                    m_tree.getElement().getStyle().setDisplay(Display.NONE);
                    setGalleriesVisible(false);
                    setModelPagesVisible(false);
                    setCategoriesVisible(true);
                    setHeaderVisible(true);
                    m_localeComparison.setVisible(false);
                    m_toolbar.setNewEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_NEW_DISABLE_0));
                    m_toolbar.setClipboardEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_CLIPBOARD_DISABLE_0));
                    getController().loadCategories(false, null);
                    break;
                case compareLocales:
                    m_tree.getElement().getStyle().setDisplay(Display.NONE);
                    setGalleriesVisible(false);
                    setModelPagesVisible(false);
                    setCategoriesVisible(false);
                    setHeaderVisible(false);
                    m_toolbar.setNewEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_NEW_DISABLE_0));
                    m_toolbar.setClipboardEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_CLIPBOARD_DISABLE_0));
                    m_localeComparison.setVisible(true);
                    m_controller.getData().getRoot().getId();
                    CmsJsUtil.callNamedFunctionWithString(
                        CmsGwtConstants.CALLBACK_REFRESH_LOCALE_COMPARISON,
                        "" + m_controller.getData().getRoot().getId());
                    break;

                default:

            }
            // check if the tree has been drawn yet
            getRootItem().updateEditorMode();
            m_toolbar.setMode(editorMode);
        }
    }
92426
public void setMode(String mode) {
        checkNotNull(mode, "mode should not be null");
        if (MODE_ASYNC.equals(mode) || MODE_SYNC.equals(mode)) {
            this.mode = mode;
        } else {
            throw new IllegalArgumentException("illegal mode: " + mode);
        }
    }
100832
@Override
    public int getSessionMode() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getSessionMode");

        int sessionMode = -1;
        try {
            sessionMode = jmsSession.getAcknowledgeMode();
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "getSessionMode", new Object[] { sessionMode });
        }

        return sessionMode;
    }
42723
private Map getAuthConfigMapToCheck(LookupMode lookupMode, Map authConfigMap) {
        String configMapKey = lookupMode.getConfigMapKey();
        if (configMapKey == null) {
            return authConfigMap;
        }
        if (authConfigMap != null) {
            return (Map) authConfigMap.get(configMapKey);
        }
        return null;
    }
413381
public static EncryptionMode getEncryptionModeCipher(String encryptionMode) {
	if (encryptionMode==null) {
		return null;
	}
	switch (encryptionMode) {
		case "agile": return EncryptionMode.agile;
		case "binaryRC4": return EncryptionMode.binaryRC4;
		case "cryptoAPI": return EncryptionMode.cryptoAPI;
		case "standard": return EncryptionMode.standard;
		default:
			LOG.error("Uknown enncryption mode \""+encryptionMode+"\"");
			break;
		//case "xor": return EncryptionMode.xor; // does not seem to be supported anymore
	}
	return null;
}
461737
public static byte[] setMode(byte pinId, Pin.Mode mode) {
        if (mode == Pin.Mode.UNSUPPORTED) {
            throw new IllegalArgumentException("Cannot set unsupported mode to pin " + pinId);
        }
        return new byte[]{SET_PIN_MODE, pinId, (byte) mode.ordinal()};
    }
83763
public ChatMode getChatMode() {
		final Presence.Mode mode = con.getRoster().getPresence(getUserId())
				.getMode();
		for (final ChatMode c : ChatMode.values()) {
			if (c.mode == mode) {
				return c;
			}
		}
		return null;
	}
870353
private void initModeSwitch(final EditMode current) {

        FormLayout modes = new FormLayout();
        modes.setHeight("100%");
        modes.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);

        m_modeSelect = new ComboBox();
        m_modeSelect.setCaption(m_messages.key(Messages.GUI_VIEW_SWITCHER_LABEL_0));

        // add Modes
        m_modeSelect.addItem(CmsMessageBundleEditorTypes.EditMode.DEFAULT);
        m_modeSelect.setItemCaption(
            CmsMessageBundleEditorTypes.EditMode.DEFAULT,
            m_messages.key(Messages.GUI_VIEW_SWITCHER_EDITMODE_DEFAULT_0));
        m_modeSelect.addItem(CmsMessageBundleEditorTypes.EditMode.MASTER);
        m_modeSelect.setItemCaption(
            CmsMessageBundleEditorTypes.EditMode.MASTER,
            m_messages.key(Messages.GUI_VIEW_SWITCHER_EDITMODE_MASTER_0));

        // set current mode as selected
        m_modeSelect.setValue(current);

        m_modeSelect.setNewItemsAllowed(false);
        m_modeSelect.setTextInputAllowed(false);
        m_modeSelect.setNullSelectionAllowed(false);

        m_modeSelect.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            public void valueChange(ValueChangeEvent event) {

                m_listener.handleModeChange((EditMode)event.getProperty().getValue());

            }
        });

        modes.addComponent(m_modeSelect);
        m_modeSwitch = modes;
    }