List of usage examples for java.lang Boolean TRUE
Boolean TRUE
To view the source code for java.lang Boolean TRUE.
Click Source Link
From source file:org.openmrs.module.metadatamapping.web.bean.validator.ConfigureFormValidator.java
/** * @see org.springframework.validation.Validator#validate(java.lang.Object, * org.springframework.validation.Errors) *//*from w w w .j ava 2 s . c o m*/ @Override public void validate(Object target, Errors errors) { ConfigureForm configureForm = (ConfigureForm) target; if (Boolean.TRUE.equals(configureForm.getAddLocalMappings())) { ValidationUtils.rejectIfEmpty(errors, "conceptSourceUuid", "metadatamapping.error.emptyConceptSource"); } if (!StringUtils.isBlank(configureForm.getConceptSourceUuid())) { ConceptSource source = Context.getService(ConceptService.class) .getConceptSourceByUuid(configureForm.getConceptSourceUuid()); if (source == null) { errors.rejectValue("conceptSourceUuid", "metadatamapping.error.missingConceptSource"); } } }
From source file:org.apache.streams.facebook.test.FacebookActivitySerDeTest.java
@Test public void Tests() { mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.TRUE); mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE); mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE); InputStream is = FacebookActivitySerDeTest.class.getResourceAsStream("/testpost.json"); Joiner joiner = Joiner.on(" ").skipNulls(); is = new BoundedInputStream(is, 10000); String json;// w w w .jav a2 s .c o m try { json = joiner.join(IOUtils.readLines(is)); LOGGER.debug(json); Post post = mapper.readValue(json, Post.class); Activity activity = serializer.deserialize(post); LOGGER.debug(mapper.writeValueAsString(activity)); } catch (Exception e) { System.out.println(e); e.printStackTrace(); Assert.fail(); } }
From source file:com.github.spring.mvc.util.handler.UriMatchingHandlerInterceptorInterceptorTest.java
@Before public void setUp() throws Throwable { interceptor = new UriMatchingHandlerInterceptorInterceptor(); when(invocation.getArguments()).thenReturn(new Object[] { request }); stub(invocation.proceed()).toReturn(Boolean.TRUE); Method method = UriMatchingHandlerInterceptor.class.getMethod("preHandle", HttpServletRequest.class, HttpServletResponse.class, Object.class); when(invocation.getMethod()).thenReturn(method); }
From source file:net.sourceforge.fenixedu.domain.Branch.java
public Boolean representsCommonBranch() { if (getBranchType() != null && getBranchType().equals(BranchType.COMNBR)) { return Boolean.TRUE; }/* w w w .ja v a 2 s . c o m*/ return Boolean.FALSE; }
From source file:com.omnigon.aem.handlebars.helpers.OrHelper.java
private Boolean isValidValue(Object value) { if (value == null || StringUtils.EMPTY.equals(value) || Boolean.FALSE.equals(value)) { return Boolean.FALSE; }/*from w w w . ja va 2 s.c o m*/ return Boolean.TRUE; }
From source file:com.baculsoft.beanutils.test.TestBeanUtil2.java
@Test public void testCopy() throws Throwable { PojoExample pojoSource = new PojoExample(); pojoSource.setStringProp("String Property"); pojoSource.setBooleanProp(true);//from w w w .j a v a2 s .c o m pojoSource.setBooleanProp1(Boolean.TRUE); pojoSource.setDateProp(new Date()); pojoSource.setByteProp1(new Byte((byte) 11)); pojoSource.setIntProp1(new Integer(15125)); pojoSource.setLongProp1(new Long(20053215235l)); pojoSource.setFloatProp1(new Float(20053215235f)); PojoExample pojoTarget = new PojoExample(); pojoDescriptor.copy(pojoSource, pojoTarget); pojoDescriptor.reset(pojoTarget); PojoExample pojoTarget2 = new PojoExample(); PojoExample pojoTarget3 = new PojoExample(); BeanUtils.copyProperties(pojoSource, pojoTarget2); org.apache.commons.beanutils.BeanUtils.copyProperties(pojoSource, pojoTarget3); long t1 = System.currentTimeMillis(); for (int i = 0; i < 50; i++) { pojoDescriptor.copy(pojoSource, pojoTarget); } t1 = System.currentTimeMillis() - t1; long t2 = System.currentTimeMillis(); for (int i = 0; i < 50; i++) { BeanUtils.copyProperties(pojoSource, pojoTarget2); } t2 = System.currentTimeMillis() - t2; long t3 = System.currentTimeMillis(); for (int i = 0; i < 50; i++) { org.apache.commons.beanutils.BeanUtils.copyProperties(pojoSource, pojoTarget3); } t3 = System.currentTimeMillis() - t3; System.out.println("Time to copy properties "); System.out.println("this class: t1 ---> " + t1); System.out.println("spring-beans: t2 --->" + t2); System.out.println("apache commons: t3 --->" + t3); System.out.println(pojoDescriptor.describe(pojoTarget).equals(pojoDescriptor.describe(pojoTarget2))); assertEquals(pojoDescriptor.describe(pojoTarget), pojoDescriptor.describe(pojoTarget2)); }
From source file:be.ugent.maf.cellmissy.gui.view.renderer.jfreechart.DirectionAutocorrelationLineAndShapeRenderer.java
@Override public Boolean getSeriesShapesFilled(int series) { return Boolean.TRUE; }
From source file:com.artivisi.belajar.restful.service.impl.UserServiceTestIT.java
@Test public void testFindById() { User ac = service.findUserById("endy"); assertNotNull(ac);//from www.ja v a 2 s .c o m assertEquals("endy", ac.getUsername()); assertEquals("Endy Muhardin", ac.getFullname()); assertEquals("123", ac.getPassword()); assertEquals(Boolean.TRUE, ac.getActive()); assertEquals("Super User", ac.getRole().getName()); assertNull(service.findUserById(null)); assertNull(service.findUserById("")); }
From source file:ch.sbb.releasetrain.webui.backingbeans.DefaultPersistence.java
public Boolean isReady() { init();/*from w w w .j a v a 2 s .c o m*/ if (email == null || jenkins == null) { return Boolean.FALSE; } if (email.getSmtpServer() == null || email.getSmtpServer().isEmpty()) { return Boolean.FALSE; } if (jenkins == null || jenkins.getJenkinsBuildToken() == null || jenkins.getJenkinsBuildToken().isEmpty()) { return Boolean.FALSE; } return Boolean.TRUE; }
From source file:com.haulmont.cuba.gui.app.security.role.edit.tabs.EntityNameFilter.java
@Override public boolean test(@Nullable T target) { if (target != null) { if (Boolean.TRUE.equals(assignedOnlyCheckBox.getValue()) && !target.isAssigned()) { return false; }//from w w w . j a v a 2s . co m if (Boolean.FALSE.equals(systemLevelCheckBox.getValue()) && (target instanceof EntityPermissionTarget) && !target.isAssigned()) { Class entityClass = ((EntityPermissionTarget) target).getEntityClass(); MetaClass metaClass = metadata.getSession().getClassNN(entityClass); if (metadata.getTools().isSystemLevel(metaClass)) { return false; } } String filterValue = StringUtils.trimToEmpty(entityFilter.<String>getValue()); return StringUtils.isBlank(filterValue) || StringUtils.containsIgnoreCase(target.getCaption(), filterValue); } return false; }