Example usage for java.lang Boolean booleanValue

List of usage examples for java.lang Boolean booleanValue

Introduction

In this page you can find the example usage for java.lang Boolean booleanValue.

Prototype

@HotSpotIntrinsicCandidate
public boolean booleanValue() 

Source Link

Document

Returns the value of this Boolean object as a boolean primitive.

Usage

From source file:de.fhg.iais.asc.xslt.binaries.DownloadAndScaleContext.java

public File downloadFile(URI uri, File permanentOriginal, boolean onlyPermanent) {
    final Boolean permanentDownload = getDownloadMode().getPermanentDownload();
    if (permanentDownload == null) {
        return null;
    }//from  ww w  .  java 2s .  co m

    final boolean isPermanent = permanentDownload.booleanValue();
    if (onlyPermanent && !isPermanent) {
        return null;
    }

    final File target = isPermanent ? permanentOriginal : createTempFile(uri);

    if (shouldRedownloadExisting() || !isValidBinaryFile(target)) {
        Downloader.forContext(this.transContext).downloadBinary(uri, target);
    }
    return target;
}

From source file:com.duroty.application.files.utils.FilesDefaultAction.java

/**
 * DOCUMENT ME!/*from   w w  w.  j a  va  2 s .  c  o m*/
 *
 * @param request DOCUMENT ME!
 *
 * @return DOCUMENT ME!
 *
 * @throws NamingException DOCUMENT ME!
 * @throws RemoteException DOCUMENT ME!
 * @throws CreateException DOCUMENT ME!
 */
protected Store getStoreInstance(HttpServletRequest request)
        throws NamingException, RemoteException, CreateException {
    StoreHome home = null;

    Boolean localServer = new Boolean(Configuration.properties.getProperty(Configuration.LOCAL_WEB_SERVER));

    if (localServer.booleanValue()) {
        home = StoreUtil.getHome();
    } else {
        Hashtable environment = getContextProperties(request);
        home = StoreUtil.getHome(environment);
    }

    return home.create();
}

From source file:com.duroty.application.files.utils.FilesDefaultAction.java

/**
 * DOCUMENT ME!//w  w  w  .  ja v a  2s .co  m
 *
 * @param request DOCUMENT ME!
 *
 * @return DOCUMENT ME!
 *
 * @throws NamingException DOCUMENT ME!
 * @throws RemoteException DOCUMENT ME!
 * @throws CreateException DOCUMENT ME!
 */
protected FilesSearch getFilesSearchInstance(HttpServletRequest request)
        throws NamingException, RemoteException, CreateException {
    FilesSearchHome home = null;

    Boolean localServer = new Boolean(Configuration.properties.getProperty(Configuration.LOCAL_WEB_SERVER));

    if (localServer.booleanValue()) {
        home = FilesSearchUtil.getHome();
    } else {
        Hashtable environment = getContextProperties(request);
        home = FilesSearchUtil.getHome(environment);
    }

    return home.create();
}

From source file:eu.intermodalics.tango_ros_streamer.ParameterNode.java

/**
 * Callback that syncs Parameter Server with changes coming from the UI (app --> server).
 * @param sharedPreferences Reference to SharedPreferences containing the preference change.
 * @param key Particular preference that changed.
 *//*  w  w w  . j ava2  s. c  o  m*/
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, final String key) {
    Map<String, ?> prefKeys = sharedPreferences.getAll();
    Object prefValue = prefKeys.get(key);
    if (Arrays.asList(mDynamicParamNames).contains(key)) {
        if (prefValue instanceof Boolean) {
            final Boolean bool = (Boolean) prefValue;
            new Thread() {
                @Override
                public void run() {
                    callDynamicReconfigure(key, bool.booleanValue());
                }
            }.start();
        }
    }
}

From source file:org.slc.sli.dashboard.web.controller.ConfigController.java

/**
 * Generic layout handler/*from   ww  w .ja v a  2  s . c o m*/
 *
 * @deprecated retiring method
 * @param id
 * @param request
 * @return
 * @throws IllegalAccessException
 */
@Deprecated
@RequestMapping(value = CONFIG_URL, method = RequestMethod.GET)
public ModelAndView getConfig(HttpServletRequest request) throws IllegalAccessException {
    ModelMap model = new ModelMap();

    String token = SecurityUtil.getToken();
    GenericEntity staffEntity = userEdOrgManager.getStaffInfo(token);

    Boolean isAdmin = SecurityUtil.isAdmin();
    if (isAdmin != null && isAdmin.booleanValue()) {
        GenericEntity edOrg = (GenericEntity) staffEntity.get(Constants.ATTR_ED_ORG);
        boolean configUser = false;

        if (edOrg != null) {
            List<String> organizationCategories = (List<String>) edOrg.get(Constants.ATTR_ORG_CATEGORIES);
            if (organizationCategories != null && !organizationCategories.isEmpty()) {
                for (String educationAgency : organizationCategories) {
                    if (educationAgency != null && educationAgency.equals(Constants.LOCAL_EDUCATION_AGENCY)) {
                        configUser = true;
                        break;
                    } else if (educationAgency != null
                            && educationAgency.equals(Constants.STATE_EDUCATION_AGENCY)) {
                        configUser = true;
                        break;
                    }
                }
            }
        }
        if (configUser) {
            ConfigMap configMap = configManager.getCustomConfig(token, userEdOrgManager.getUserEdOrg(token));

            if (configMap != null) {
                model.addAttribute("configJSON", new GsonBuilder().create().toJson(configMap));
            } else {
                model.addAttribute("configJSON", "");
            }
        } else {
            model.addAttribute("configJSON", "nonLocalEducationAgency");

        }

        addCommonData(model, request);
        model.addAttribute(Constants.PAGE_TO_INCLUDE, DASHBOARD_CONFIG_FTL);
        return new ModelAndView(Constants.OVERALL_CONTAINER_PAGE, model);
    }
    throw new IllegalAccessException("Access Denied");
}

From source file:com.gst.portfolio.paymenttype.domain.PaymentType.java

public Map<String, Object> update(final JsonCommand command) {

    final Map<String, Object> actualChanges = new LinkedHashMap<>(3);

    if (command.isChangeInStringParameterNamed(PaymentTypeApiResourceConstants.NAME, this.name)) {
        final String newValue = command.stringValueOfParameterNamed(PaymentTypeApiResourceConstants.NAME);
        actualChanges.put(PaymentTypeApiResourceConstants.NAME, newValue);
        this.name = StringUtils.defaultIfEmpty(newValue, null);
    }//w  ww .  ja  va2  s  .  c o  m

    if (command.isChangeInStringParameterNamed(PaymentTypeApiResourceConstants.DESCRIPTION, this.description)) {
        final String newDescription = command
                .stringValueOfParameterNamed(PaymentTypeApiResourceConstants.DESCRIPTION);
        actualChanges.put(PaymentTypeApiResourceConstants.DESCRIPTION, newDescription);
        this.description = StringUtils.defaultIfEmpty(newDescription, null);
    }

    if (command.isChangeInBooleanParameterNamed(PaymentTypeApiResourceConstants.ISCASHPAYMENT,
            this.isCashPayment)) {
        final Boolean newCashPaymentType = command
                .booleanObjectValueOfParameterNamed(PaymentTypeApiResourceConstants.ISCASHPAYMENT);
        actualChanges.put(PaymentTypeApiResourceConstants.ISCASHPAYMENT, newCashPaymentType);
        this.isCashPayment = newCashPaymentType.booleanValue();
    }

    if (command.isChangeInLongParameterNamed(PaymentTypeApiResourceConstants.POSITION, this.position)) {
        final Long newPosition = command.longValueOfParameterNamed(PaymentTypeApiResourceConstants.POSITION);
        actualChanges.put(PaymentTypeApiResourceConstants.POSITION, newPosition);
        this.position = newPosition;
    }

    return actualChanges;
}

From source file:com.xpn.xwiki.plugin.wikimanager.doc.XWikiServer.java

/**
 * @return true if wiki is in secure mode (https), false if in simple non-secure (http) mode.
 *//*from w  ww .j av a2s  .  c om*/
public boolean getSecure() {
    Boolean secure = getBooleanValue(XWikiServerClass.FIELD_SECURE);

    return secure != null && secure.booleanValue();
}

From source file:jp.go.aist.six.util.core.persist.castor.ExtendedCastorTemplate.java

/**
 *//*from w  w w. jav a 2 s  . c o m*/
public boolean isPersistent(final Object entity) throws DataAccessException {
    Boolean isPersistent = (Boolean) execute(new CastorCallback() {
        public Object doInCastor(final Database database) throws PersistenceException {
            boolean result = database.isPersistent(entity);
            return Boolean.valueOf(result);
        }
    });

    return isPersistent.booleanValue();
}

From source file:com.autentia.intra.util.ConfigurationUtil.java

/**
 * Return a boolean value representing the value of isUsingExternalCss.
 *
 * @return/*from  w  w  w. j a  va  2 s  .co m*/
 */
public boolean isUsingExternalCss() {
    String valor = getProperty("isUsingExternalCss", "false");
    Boolean ret = new Boolean(valor);
    return ret.booleanValue();
}

From source file:com.aurel.track.fieldType.runtime.system.check.SystemAccessLevelRT.java

/**
 * Parses the string value into the corresponding object value
 * @param isoStrValue/*  ww w.  j a  v a  2  s  . c om*/
 * @return
 */
@Override
public Object parseISOValue(Object isoStrValue) {
    if (isoStrValue == null) {
        return TWorkItemBean.ACCESS_LEVEL_PUBLIC;
    } else {
        Boolean accessLevel = new Boolean(isoStrValue.toString());
        if (accessLevel.booleanValue()) {
            return TWorkItemBean.ACCESS_LEVEL_PRIVATE;
        }
        return TWorkItemBean.ACCESS_LEVEL_PUBLIC;
    }
}