Example usage for java.lang Boolean FALSE

List of usage examples for java.lang Boolean FALSE

Introduction

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

Prototype

Boolean FALSE

To view the source code for java.lang Boolean FALSE.

Click Source Link

Document

The Boolean object corresponding to the primitive value false .

Usage

From source file:com.greenline.guahao.web.module.home.controllers.json.patient.JsonPatientController.java

/**
 * json/*from  w  w  w .ja  va2 s  . c om*/
 * 
 * @param model
 * @param patientId
 * @return OperationJsonObject
 */
@MethodRemark(value = "remark=json,method=ajax,patientId=id")
@RequestMapping(value = JsonPathConstants.J_PATIENT_DEL_PATH, method = RequestMethod.GET)
public @ResponseBody BaseJsonObject patientDel(ModelMap model, @PathVariable("pid") String patientId) {
    BaseJsonObject json = new BaseJsonObject(Boolean.FALSE, MobileMsgConstants.M_PATIENT_DEL_SUC);
    // id
    String decodePatientId = DESUtil.DESDecode(patientId, EncodeKeyConstants.PATIENT_ENCODE_KEY);
    if (!StringUtils.isNumeric(decodePatientId)) {
        // id?
        json.setHasError(Boolean.TRUE);
        json.setCode(ReservationConstants.RESERVATION_ERROR_CODE_JSON);
        json.setMessage("?");
    } else {
        PatientInfoDO patientInfoDO = patientManager.getPatientByPatientId(Long.parseLong(decodePatientId));
        if (null != patientInfoDO) {
            Long userId = UserCookieUtil.getUserId(request);
            if (!userId.toString().equals(String.valueOf(patientInfoDO.getUser_id()))) {
                // ??
                json.setHasError(Boolean.TRUE);
                json.setCode(ReservationConstants.RESERVATION_ERROR_CODE_JSON);
                json.setMessage("?");
            } else {
                PatientResult pr = patientManager.removePatient(Long.valueOf(decodePatientId));
                if (pr.isSystemError()) {
                    json.setHasError(Boolean.TRUE);
                    json.setMessage(pr.getResponseDesc());
                }
            }
        }
    }
    return json;
}

From source file:info.rsdev.xb4j.util.file.DefaultXmlCodingFactory.java

@Override
public OutputStream getDecodingStream(File toFile, String xmlEncodingType, Object... parameters) {
    return super.getDecodingStream(toFile, xmlEncodingType, prependParameter(Boolean.FALSE, parameters));
}

From source file:com.google.gxp.js.JavascriptAppenderTest.java

public void testWriteBoolean() throws Exception {
    JavascriptAppender.INSTANCE.append(out, gxpContext, Boolean.TRUE);
    assertOutputEquals("true");

    JavascriptAppender.INSTANCE.append(out, gxpContext, Boolean.FALSE);
    assertOutputEquals("false");
}

From source file:com.inkubator.hrm.web.employee.EmpPtkpFormController.java

private EmpDataModel getModelFromEntity(EmpData entity) {
    EmpDataModel model = new EmpDataModel();
    model.setId(entity.getId());/*  w ww .  ja  v a  2 s  .  c  o m*/
    model.setPtkpNumber(entity.getPtkpNumber());
    if (entity.getPtkpStatus() != null) {
        if (entity.getPtkpStatus().equals(Boolean.FALSE)) {
            model.setPtkpStatusInt(0);
            isDisabledPtkpNumber = Boolean.TRUE;
        } else if (entity.getPtkpStatus().equals(Boolean.TRUE)) {
            model.setPtkpStatusInt(1);
            isDisabledPtkpNumber = Boolean.FALSE;
        }
    }
    model.setNikAndName(entity.getNik() + " - " + entity.getBioData().getFirstName() + " "
            + entity.getBioData().getLastName());
    return model;
}

From source file:org.sakaiproject.genericdao.hibernate.CompleteGenericDaoTest.java

@Before
public void onSetUp() throws Exception {
    // get the GenericDaoFinder from the spring context (you should inject this)
    genericDao = (CompleteGenericDao) applicationContext
            .getBean("org.sakaiproject.genericdao.dao.CompleteGenericDao");
    if (genericDao == null) {
        throw new RuntimeException("onSetUp: CompleteGenericDao could not be retrieved from spring context");
    }/*from ww w  . j  ava  2  s  . co  m*/

    gto1 = new GenericTestObject(TEST_TITLE, Boolean.FALSE);
    gto2 = new GenericTestObject(TEST_TITLE + "2", Boolean.FALSE);
    gto3 = new GenericTestObject(TEST_TITLE + "3", Boolean.FALSE);
    gto4 = new GenericTestObject(TEST_TITLE + "4", Boolean.TRUE);
    gto5 = new GenericTestObject(TEST_TITLE + "5", Boolean.TRUE);

    // preload data
    genericDao.save(gto1);
    genericDao.save(gto2);
    genericDao.save(gto3);
    genericDao.save(gto4);
    genericDao.save(gto5);
}

From source file:nz.co.senanque.rules.OperationsImpl.java

@InternalFunction(operator = "==", precedence = 10)
public Boolean eq(Object value, Object value2) {
    if (value == null && value2 == null) {
        return Boolean.TRUE;
    }//from w  w w. ja  v  a2s .com
    if (value != null) {
        return new Boolean((value.equals(value2)));
    }
    return Boolean.FALSE;
}

From source file:Main.java

/**
 * <p>Converts an int to a Boolean specifying the conversion values.</p>
 *
 * <p>NOTE: This returns null and will throw a NullPointerException if autoboxed to a boolean. </p>
 *
 * <pre>/*from w w w  .  ja v a  2  s .  c o m*/
 *   BooleanUtils.toBooleanObject(0, 0, 2, 3) = Boolean.TRUE
 *   BooleanUtils.toBooleanObject(2, 1, 2, 3) = Boolean.FALSE
 *   BooleanUtils.toBooleanObject(3, 1, 2, 3) = null
 * </pre>
 *
 * @param value  the Integer to convert
 * @param trueValue  the value to match for {@code true}
 * @param falseValue  the value to match for {@code false}
 * @param nullValue  the value to to match for {@code null}
 * @return Boolean.TRUE, Boolean.FALSE, or {@code null}
 * @throws IllegalArgumentException if no match
 */
public static Boolean toBooleanObject(int value, int trueValue, int falseValue, int nullValue) {
    if (value == trueValue) {
        return Boolean.TRUE;
    }
    if (value == falseValue) {
        return Boolean.FALSE;
    }
    if (value == nullValue) {
        return null;
    }
    // no match
    throw new IllegalArgumentException("The Integer did not match any specified value");
}

From source file:org.apache.streams.gnip.powertrack.ActivityXMLActivitySerializer.java

public ActivityXMLActivitySerializer() {
    mapper = new ObjectMapper();
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
    mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
    mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);
    xmlMapper = new XmlMapper();
    xmlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
    xmlMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
    xmlMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);
}

From source file:com.snapdeal.archive.dao.impl.ArchivalDbDaoImpl.java

@Override
@Transactional("archivalTransactionManager")
public Integer insertToArchivalDB(RelationTable rt, List<Map<String, Object>> result) throws BusinessException {

    // if the result to be added in archival db is empty, then simply return
    if (result.isEmpty()) {
        SystemLog.logMessage("No data to be archived for : " + rt.getTableName());
        return 0;
    }//from ww  w  .  j a  va  2  s. c  om

    StringBuilder columnNameBuilder = new StringBuilder();
    StringBuilder placeHolderBuilder = new StringBuilder();

    List<Object[]> batchArgs = new ArrayList<>();
    Boolean isFirst = Boolean.TRUE;
    for (Map<String, Object> map : result) {
        List<Object> values = new ArrayList<>();
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            if (isFirst) {
                columnNameBuilder.append(entry.getKey() + ", ");
                placeHolderBuilder.append("?, ");
            }
            values.add(entry.getValue());
        }
        batchArgs.add(values.toArray());
        isFirst = Boolean.FALSE;
    }
    String columnNames = columnNameBuilder.toString();
    columnNames = columnNames.substring(0, columnNames.length() - 2);

    String placeHolder = placeHolderBuilder.toString();
    placeHolder = placeHolder.substring(0, placeHolder.length() - 2);

    //INSERT INTO FORUMS (FORUM_ID, FORUM_NAME, FORUM_DESC) VALUES (?,?,?)
    String query = "INSERT IGNORE INTO " + rt.getTableName() + " (" + columnNames + " ) VALUES (" + placeHolder
            + " )";
    SystemLog.logMessage(
            "Inserting data for table...  : " + rt.getTableName() + ", total records are :   " + result.size());
    try {
        TimeTracker tt = new TimeTracker();
        tt.startTracking();
        int[] batchUpdateResult = archivalJdbcTemplate.batchUpdate(query, batchArgs);
        tt.trackTimeInSeconds("^^^^^^^^^^Total time taken to execute update query is  :");
        SystemLog.logMessage("Result is : " + batchUpdateResult.length);
        return batchUpdateResult.length;
    } catch (Exception e) {
        e.printStackTrace();
        SystemLog.logMessage(e.getMessage());
        throw new BusinessException(e);
    }

}

From source file:org.statefulj.demo.ddd.config.DBConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setGenerateDdl(Boolean.TRUE);
    vendorAdapter.setShowSql(Boolean.FALSE);

    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setDataSource(dataSource());
    factory.setJpaVendorAdapter(vendorAdapter);
    factory.setPackagesToScan("org.statefulj.demo.ddd", "org.statefulj.webapp.model");
    return factory;
}