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:com.comcast.magicwand.spells.saucelabs.SauceProvider.java

/**
 * Creates an instance of a SauceProvider class
 * @param ingridients Set of {@link PhoenixDriverIngredients} to use for driver creation
 * @param capabilities Set of {@link DesiredCapabilities} to use for driver creation
 *
 *//*www. j a  v  a  2 s .co m*/
public SauceProvider(PhoenixDriverIngredients ingridients, DesiredCapabilities capabilities) {
    // extract data
    this.driverCustomConfig = ingridients.getDriverConfigs();
    this.apiKey = (String) driverCustomConfig.get(API_KEY);
    this.cookieHandler = (CookieHandler) driverCustomConfig.get(COOKIE_HANDLER);
    String url = (String) driverCustomConfig.get(URL);

    urlStr = (null == url) ? DEFAULT_URL : url;

    // url for sauce storage location
    String sauceStorageUrl = (String) driverCustomConfig.get(SAUCE_STOTAGE_URL);
    sauceStorageUrlStr = (null == sauceStorageUrl) ? DEFAULT_SAUCE_STORAGE_URL : sauceStorageUrl;

    // Initializing to empty list
    filesToUpload = new ArrayList<String>();
    Object filesObject = this.driverCustomConfig.get(SAUCE_FILES_UPLOAD);
    // Adding a null check so that SAUCE_FILES_UPLOAD will not be a mandatory field
    if (null != filesObject) {
        if (filesObject instanceof List<?>) {
            filesToUpload = (List) filesObject;
        } else {
            LOG.error(
                    "Error: Invalid data type for driver ingredient {}; continuing with empty file list. Expected data type: List holding file path",
                    SAUCE_FILES_UPLOAD);
        }
    }

    this.username = (String) driverCustomConfig.get(USERNAME);

    Boolean vpn = (Boolean) driverCustomConfig.get(VPN);
    this.useVpn = (null == vpn) ? false : vpn.booleanValue();

    this.desktopOS = ingridients.getDesktopOS();

    this.customCapabilities = capabilities;
}

From source file:com.googlecode.android_scripting.facade.EventFacade.java

/**
 * <pre>//from   w w  w .  j a v  a 2s  .c o m
 * Example:
 *   import android
 *   from datetime import datetime
 *   droid = android.Android()
 *   t = datetime.now()
 *   droid.eventPost('Some Event', t)
 * </pre>
 */
@Rpc(description = "Post an event to the event queue.")
public void eventPost(@RpcParameter(name = "name", description = "Name of event") String name,
        @RpcParameter(name = "data", description = "Data contained in event.") String data,
        @RpcParameter(name = "enqueue", description = "Set to False if you don't want your events to be added to the event queue, just dispatched.") @RpcOptional @RpcDefault("false") Boolean enqueue) {
    postEvent(name, data, enqueue.booleanValue());
}

From source file:com.basistech.m2e.code.quality.checkstyle.MavenPluginConfigurationTranslator.java

/**
 * Get the {@literal includeTestSourceDirectory} element value if present in the configuration.
 *
 * @return the value of the {@code includeTestSourceDirectory} element.
 * @throws CoreException/*from  ww  w .j  a v a  2 s .c o  m*/
 */
public boolean getIncludeTestSourceDirectory() throws CoreException {
    Boolean includeTestSourceDirectory = configurator.getParameterValue("includeTestSourceDirectory",
            Boolean.class, session, execution);
    if (includeTestSourceDirectory != null) {
        return includeTestSourceDirectory.booleanValue();
    } else {
        return false;
    }
}

From source file:com.opensymphony.module.propertyset.database.JDBCPropertySet.java

private void setValues(PreparedStatement ps, int type, String key, Object value)
        throws SQLException, PropertyException {
    // Patched by Edson Richter for MS SQL Server JDBC Support!
    String driverName;//  www  . j  a  va  2 s  .  co m

    try {
        driverName = ps.getConnection().getMetaData().getDriverName().toUpperCase();
    } catch (Exception e) {
        driverName = "";
    }

    ps.setNull(1, Types.VARCHAR);
    ps.setNull(2, Types.TIMESTAMP);

    // Patched by Edson Richter for MS SQL Server JDBC Support!
    // Oracle support suggestion also Michael G. Slack
    if ((driverName.indexOf("SQLSERVER") >= 0) || (driverName.indexOf("ORACLE") >= 0)) {
        ps.setNull(3, Types.BINARY);
    } else {
        ps.setNull(3, Types.BLOB);
    }

    ps.setNull(4, Types.FLOAT);
    ps.setNull(5, Types.NUMERIC);
    ps.setInt(6, type);
    ps.setString(7, globalKey);
    ps.setString(8, key);

    switch (type) {
    case PropertySet.BOOLEAN:

        Boolean boolVal = (Boolean) value;
        ps.setInt(5, boolVal.booleanValue() ? 1 : 0);

        break;

    case PropertySet.DATA:

        Data data = (Data) value;
        ps.setBytes(3, data.getBytes());

        break;

    case PropertySet.DATE:

        Date date = (Date) value;
        ps.setTimestamp(2, new Timestamp(date.getTime()));

        break;

    case PropertySet.DOUBLE:

        Double d = (Double) value;
        ps.setDouble(4, d.doubleValue());

        break;

    case PropertySet.INT:

        Integer i = (Integer) value;
        ps.setInt(5, i.intValue());

        break;

    case PropertySet.LONG:

        Long l = (Long) value;
        ps.setLong(5, l.longValue());

        break;

    case PropertySet.STRING:
        ps.setString(1, (String) value);

        break;

    default:
        throw new PropertyException("This type isn't supported!");
    }
}

From source file:eu.supersede.gr.rest.GameRest.java

@RequestMapping(value = "/enact/{gameId}", method = RequestMethod.PUT)
public void doEnactGame(Authentication authentication, @PathVariable Long gameId,
        @RequestParam("useIF") Boolean useIf) {
    System.out.println("Sending requirements fo enactment - useIF = " + useIf.booleanValue());

    String tenant = ((DatabaseUser) authentication.getPrincipal()).getTenantId();
    HAHPGame g = games.findOne(gameId);/*from  www.ja  v  a  2 s.  c  o  m*/
    double max = 1;
    Map<String, Double> rs = AHPRest.CalculateAHP(g.getCriterias(), g.getRequirements(),
            criteriasMatricesData.findByGame(g), g.getRequirementsMatrixData());

    for (Double d : rs.values()) {
        if (d > max) {
            max = d;
        }
    }

    FeatureList list = new FeatureList();

    for (Requirement r : g.getRequirements()) {
        Feature feature = new Feature();
        feature.setName(r.getName());
        feature.setPriority(6 - ((int) (1 + ((rs.get("" + r.getRequirementId()) / max) * 5))));
        feature.setId("" + r.getRequirementId());
        System.out.println("Added feature with id: " + feature.getId());
        list.list().add(feature);
    }

    EnactmentService.get().send(list, (useIf != null ? useIf.booleanValue() : true), tenant);
}

From source file:com.clarkparsia.sbol.editor.sparql.StardogEndpoint.java

@Override
public boolean executeAskQuery(String query) throws QueryEvaluationException {
    try {/*from w ww  .ja  v  a  2 s  .c  o m*/
        Boolean result = null;
        HttpMethod response = executeQuery(query);
        try {
            InputStream in = response.getResponseBodyAsStream();
            result = booleanParser.parse(in);
            return result.booleanValue();
        } catch (HttpException e) {
            throw new QueryEvaluationException(e);
        } catch (QueryResultParseException e) {
            throw new QueryEvaluationException(e);
        } finally {
            if (result == null) {
                response.abort();
            }
        }
    } catch (IOException e) {
        throw new QueryEvaluationException(e);
    }
}

From source file:module.siadap.domain.SiadapEvaluationUniverse.java

public int getObjectivesPonderation() {
    final Boolean evaluatedOnlyByCompetences = getSiadap().getEvaluatedOnlyByCompetences();
    if (evaluatedOnlyByCompetences != null && evaluatedOnlyByCompetences.booleanValue()) {
        return 0;
    }//from w w w  .j  a  v a  2 s  .co m
    if (getSiadapUniverse() == SiadapUniverse.SIADAP2) {
        return getSiadap().getSiadapYearConfiguration().getSiadap2ObjectivesPonderation();
    }
    if (getSiadapUniverse() == SiadapUniverse.SIADAP3) {
        return getSiadap().getSiadapYearConfiguration().getSiadap3ObjectivesPonderation();
    }
    return 0;
}

From source file:module.siadap.domain.SiadapEvaluationUniverse.java

public int getCompetencesPonderation() {
    final Boolean evaluatedOnlyByCompetences = getSiadap().getEvaluatedOnlyByCompetences();
    if (evaluatedOnlyByCompetences != null && evaluatedOnlyByCompetences.booleanValue()) {
        return 100;
    }//w  w  w. jav  a 2s.co  m
    if (getSiadapUniverse() == SiadapUniverse.SIADAP2) {
        return getSiadap().getSiadapYearConfiguration().getSiadap2CompetencesPonderation();
    }
    if (getSiadapUniverse() == SiadapUniverse.SIADAP3) {
        return getSiadap().getSiadapYearConfiguration().getSiadap3CompetencesPonderation();
    }
    return 0;
}

From source file:module.siadap.domain.SiadapEvaluationUniverse.java

public BigDecimal getTotalEvaluationScoring() {
    if (isWithSkippedEvaluation()) {
        return null;
    }/*from   w  w w .  j a va  2  s . c  om*/
    if (isCurriculumPonderation()) {
        return CurricularPonderationEvaluationItem.getCurricularPonderationValue(this);
    }
    //let's make see the other special case, i.e. when the evaluated is only evaluated by competences
    final Boolean evaluatedOnlyByCompetences = getSiadap().getEvaluatedOnlyByCompetences();
    if (evaluatedOnlyByCompetences != null && evaluatedOnlyByCompetences.booleanValue()) {
        return getEvaluationScoring(getCompetenceEvaluations());
    }

    return getPonderatedCompetencesScoring().add(getPonderatedObjectivesScoring());
}