List of usage examples for java.lang Boolean FALSE
Boolean FALSE
To view the source code for java.lang Boolean FALSE.
Click Source Link
From source file:de.cosmocode.collections.utility.Convert.java
@edu.umd.cs.findbugs.annotations.SuppressWarnings("NP_BOOLEAN_RETURN_NULL") private static Boolean doIntoBoolean(Object value) { if (value == null) return null; if (value instanceof Boolean) return Boolean.class.cast(value); final String converted = doIntoString(value); if ("true".equalsIgnoreCase(converted)) { return Boolean.TRUE; } else if ("false".equalsIgnoreCase(converted)) { return Boolean.FALSE; } else {/*from w w w .j av a2 s.c o m*/ return null; } }
From source file:net.sf.jasperreports.functions.standard.LogicalFunctions.java
/** * Returns the logical value FALSE. */ @Function("FALSE") public static Boolean FALSE() { return Boolean.FALSE; }
From source file:cz.muni.fi.pa165.deliveryservice.service.CourierServiceImpl.java
@PreAuthorize("hasRole('ROLE_ADMIN')") @Override/*from w ww . j a va 2 s . co m*/ public void deleteCourier(CourierDTO courierDto) { if (courierDto == null) { throw new NullPointerException(); } Courier courier = courierDao.findCourier(courierDto.getId()); courier.setActive(Boolean.FALSE); courierDao.updateCourier(courier); }
From source file:gr.abiss.calipso.jpasearch.specifications.BooleanPredicateFactory.java
/** * @see gr.abiss.calipso.jpasearch.jpa.search.specifications.IPredicateFactory#addPredicate(javax.persistence.criteria.Root, * javax.persistence.criteria.CriteriaBuilder, java.lang.String, * java.lang.Class, java.lang.String[]) *//*from w ww .j av a 2 s . co m*/ @Override public Predicate getPredicate(Root<Persistable> root, CriteriaBuilder cb, String propertyName, Class fieldType, String[] propertyValues) { Predicate predicate = null; if (!Boolean.class.isAssignableFrom(fieldType)) { throw new IllegalArgumentException( fieldType + " is not a subclass of Boolean for field: " + propertyName); } Boolean b = BooleanUtils.toBooleanObject(propertyValues[0]); if (b == null) { b = Boolean.FALSE; } predicate = cb.equal(root.<Boolean>get(propertyName), b); return predicate; }
From source file:com.eureka.v1_0.account.information.impl.AccountServiceImpl.java
@Override @Transactional/*from w w w . j a va 2 s . c o m*/ public Account post(Account account) throws Exception { if (account != null) { try { account.setExternalUid(RandomStringUtils.randomAlphanumeric(128)); account.setVerificationToken(RandomStringUtils.randomAlphanumeric(128)); account.setCreationDate(Calendar.getInstance().getTime()); account.setPassword(this.securePasswordService.createSecurePassword(account.getPassword())); account.setVerificationStatus(Boolean.FALSE); return account; } finally { if (em != null) { em.close(); } } } throw new NullPointerException("Account object cannot be NULL. Please send a valid object"); }
From source file:mx.com.quadrum.service.impl.UsuarioServiceImpl.java
@Override public String agregar(Usuario usuario) { usuario.setPrimeraSesion(true);//from ww w .j a v a2 s. c o m usuario.setPassword(generaPassword()); usuario.setEsAdmin(Boolean.FALSE); if (usuarioRepository.agregar(usuario)) { try { EnviarCorreo enviarCorreo = new EnviarCorreo(); enviarCorreo.enviaCredenciales(usuario.getMail(), ACCESO_SISTEMA, MENSAJE + "\n\t\tUsuario:\t" + usuario.getMail() + "\n\t\tPassword:\t" + usuario.getPassword()); crearCarpetaArchivosUsuarios(usuario.getMail()); return ADD_CORRECT + USUARIO + usuario.getId(); } catch (MessagingException ex) { Logger.getLogger(UsuarioServiceImpl.class.getName()).log(Level.SEVERE, null, ex); } } return ERROR_HIBERNATE; }
From source file:com.moviejukebox.TestLogger.java
/** * configure the logger with a simple in-memory file for the required log level * * @param level The logging level required * @return True if successful/*from www .j a v a 2 s .c om*/ */ public static boolean configure(String level) { StringBuilder config = new StringBuilder("handlers = java.util.logging.ConsoleHandler\n"); config.append(".level = ").append(level).append(CRLF); config.append("java.util.logging.ConsoleHandler.level = ").append(level).append(CRLF); // Only works with Java 7 or later config.append("java.util.logging.SimpleFormatter.format = [%1$tH:%1$tM:%1$tS %4$6s] %2$s - %5$s %6$s%n") .append(CRLF); // Exclude http logging config.append("sun.net.www.protocol.http.HttpURLConnection.level = OFF").append(CRLF); config.append("org.apache.http.level = SEVERE").append(CRLF); try (InputStream ins = new ByteArrayInputStream(config.toString().getBytes())) { LogManager.getLogManager().readConfiguration(ins); } catch (IOException e) { LOG.warn("Failed to configure log manager due to an IO problem", e); return Boolean.FALSE; } LOG.debug("Logger initialized to '{}' level", level); return Boolean.TRUE; }
From source file:ch.ralscha.extdirectspring.util.ExtDirectSpringUtilTest.java
@Test public void testEqual() { assertThat(ExtDirectSpringUtil.equal(1, 1)).isTrue(); assertThat(ExtDirectSpringUtil.equal(1, 2)).isFalse(); assertThat(ExtDirectSpringUtil.equal(true, true)).isTrue(); assertThat(ExtDirectSpringUtil.equal(false, false)).isTrue(); assertThat(ExtDirectSpringUtil.equal(true, false)).isFalse(); assertThat(ExtDirectSpringUtil.equal(false, true)).isFalse(); assertThat(ExtDirectSpringUtil.equal(false, null)).isFalse(); assertThat(ExtDirectSpringUtil.equal(Boolean.TRUE, Boolean.TRUE)).isTrue(); assertThat(ExtDirectSpringUtil.equal(Boolean.FALSE, Boolean.FALSE)).isTrue(); assertThat(ExtDirectSpringUtil.equal(Boolean.TRUE, Boolean.FALSE)).isFalse(); assertThat(ExtDirectSpringUtil.equal(Boolean.FALSE, Boolean.TRUE)).isFalse(); assertThat(ExtDirectSpringUtil.equal(Boolean.FALSE, null)).isFalse(); assertThat(ExtDirectSpringUtil.equal("a", "a")).isTrue(); assertThat(ExtDirectSpringUtil.equal("a", "b")).isFalse(); assertThat(ExtDirectSpringUtil.equal(null, "a")).isFalse(); assertThat(ExtDirectSpringUtil.equal("a", null)).isFalse(); assertThat(ExtDirectSpringUtil.equal(null, null)).isTrue(); }
From source file:org.jasig.cas.event.advice.AuthenticationHandlerMethodInterceptorTests.java
public void testAuthenticationEventWithBooleanFalse() throws Throwable { this.advice.invoke(new BooleanMethodInvocation(Boolean.FALSE)); assertNotNull(this.event); assertFalse(this.event.isSuccessfulAuthentication()); }
From source file:com.oneops.sensor.ecv.AppHealthCheck.java
@Override public IHealth getHealth() { IHealth health = Health.FAILED_HEALTH; try {// w w w . j a v a 2 s . c o m @SuppressWarnings("unused") String ciState = coProcessor.getCIstate(DEFAULT_CID); health = Health.OK_HEALTH; } catch (Throwable e) { logger.error("Exception occurred determining health", e); health = new Health(HttpStatus.INTERNAL_SERVER_ERROR.value(), Boolean.FALSE, e.getMessage(), getName()); } return health; }