Example usage for java.lang Boolean TRUE

List of usage examples for java.lang Boolean TRUE

Introduction

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

Prototype

Boolean TRUE

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

Click Source Link

Document

The Boolean object corresponding to the primitive value true .

Usage

From source file:net.sourceforge.fenixedu.applicationTier.Servico.teacher.RemoveProfessorshipWithPerson.java

@Atomic
public static Boolean run(Person person, ExecutionCourse executionCourse) throws NotAuthorizedException {
    AbstractModifyProfessorshipWithPerson.run(person);

    Professorship professorshipToDelete = person.getProfessorshipByExecutionCourse(executionCourse);

    Collection shiftProfessorshipList = professorshipToDelete.getAssociatedShiftProfessorshipSet();

    boolean hasCredits = false;

    if (!shiftProfessorshipList.isEmpty()) {
        hasCredits = CollectionUtils.exists(shiftProfessorshipList, new Predicate() {

            @Override//from  w w w.  j a  va2  s  . c  o m
            public boolean evaluate(Object arg0) {
                ShiftProfessorship shiftProfessorship = (ShiftProfessorship) arg0;
                return shiftProfessorship.getPercentage() != null && shiftProfessorship.getPercentage() != 0;
            }
        });
    }

    if (!hasCredits) {
        professorshipToDelete.delete();
    } else {
        if (hasCredits) {
            throw new DomainException("error.remove.professorship");
        }
    }
    return Boolean.TRUE;
}

From source file:uk.ac.aber.raf8.mmp.core.jobs.YQLCacheSectorsQueryJob.java

@Override
protected void executeInternal(final JobExecutionContext jobExecutionContext) throws JobExecutionException {
    Boolean success = Boolean.FALSE;
    Integer tries = 0;/* w ww . j a v a  2 s.  com*/
    while (!success && tries < MAX_TRIES) {
        try {
            YQLQueryCache.getInstance()
                    .setYQLSectorsQueryModel(YQLService.getInstance().getYQLSectorsQueryModel());
            success = Boolean.TRUE;
        } catch (final Exception e) {
            e.printStackTrace();
            tries++;
            try {
                Thread.sleep(DELAY_BETWEEN_TRIES);
            } catch (final InterruptedException e1) {
                e1.printStackTrace();
            }
        }
    }
}

From source file:com.sap.prd.mobile.ios.mios.AlternatePublicHeaderFolderPathTest.java

@BeforeClass
public static void __setup() throws Exception {

    dynamicVersion = "1.0." + String.valueOf(System.currentTimeMillis());
    testName = AlternatePublicHeaderFolderPathTest.class.getName() + File.separator
            + Thread.currentThread().getStackTrace()[1].getMethodName();

    remoteRepositoryDirectory = getRemoteRepositoryDirectory(
            AlternatePublicHeaderFolderPathTest.class.getName());

    prepareRemoteRepository(remoteRepositoryDirectory);

    Properties pomReplacements = new Properties();
    pomReplacements.setProperty(PROP_NAME_DEPLOY_REPO_DIR, remoteRepositoryDirectory.getAbsolutePath());
    pomReplacements.setProperty(PROP_NAME_DYNAMIC_VERSION, dynamicVersion);

    Map<String, String> additionalSystemProperties = new HashMap<String, String>();
    additionalSystemProperties.put("mios.ota-service.url",
            "http://apple-ota.wdf.sap.corp:8080/ota-service/HTML");
    additionalSystemProperties.put("xcode.app.defaultConfigurations", "Release");
    additionalSystemProperties.put("xcode.app.defaultSdks", "iphoneos");
    additionalSystemProperties.put("archive.dir", "archive");
    additionalSystemProperties.put("xcode.useSymbolicLinks", Boolean.TRUE.toString());

    test(testName, new File(getTestRootDirectory(), "straight-forward/MyLibrary"), "deploy", THE_EMPTY_LIST,
            THE_EMPTY_MAP, pomReplacements, new AbstractProjectModifier() {

                @Override/*from w  ww . ja v a 2s. c  o m*/
                public void execute() throws Exception {
                    final File pom = new File(testExecutionDirectory, "pom.xml");

                    final Model model = getModel(pom);
                    Plugin plugin = model.getBuild().getPlugins().get(0);
                    Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
                    Xpp3Dom alternatePublicHeaderFolderPath = new Xpp3Dom("alternatePublicHeaderFolderPath");
                    alternatePublicHeaderFolderPath.setValue("MyLibrary");
                    configuration.addChild(alternatePublicHeaderFolderPath);

                    persistModel(pom, model);
                }
            });
}

From source file:org.easit.core.controllers.twitter.TwitterAfterConnectInterceptor.java

@Override
public void preConnect(ConnectionFactory<Twitter> provider, MultiValueMap<String, String> parameters,
        WebRequest request) {/*  w  w w . j  av  a  2 s.co  m*/
    if (StringUtils.hasText(request.getParameter(POST_TWEET_PARAMETER))) {
        request.setAttribute(POST_TWEET_ATTRIBUTE, Boolean.TRUE, WebRequest.SCOPE_SESSION);
    }
}

From source file:com.autentia.wuija.trace.TraceRepository.java

public void save(OperationalTrace trace) {
    if (Boolean.TRUE.equals(operationalTraceActive)) {
        dao.persist(trace);
    }
}

From source file:org.apache.streams.facebook.test.FacebookPageSerDeTest.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 = FacebookPostSerDeTest.class.getResourceAsStream("/testpage.json");
    Joiner joiner = Joiner.on(" ").skipNulls();
    is = new BoundedInputStream(is, 10000);
    String json;// w  ww .j  a v a  2 s.  com

    try {
        json = joiner.join(IOUtils.readLines(is));
        LOGGER.debug(json);

        Page ser = mapper.readValue(json, Page.class);

        String de = mapper.writeValueAsString(ser);

        LOGGER.debug(de);

        Page serde = mapper.readValue(de, Page.class);

        Assert.assertEquals(ser, serde);

        LOGGER.debug(mapper.writeValueAsString(serde));

    } catch (Exception e) {
        System.out.println(e);
        e.printStackTrace();
        Assert.fail();
    }
}

From source file:org.training.storefront.forms.validation.PaymentDetailsValidator.java

@Override
public void validate(final Object object, final Errors errors) {
    final PaymentDetailsForm form = (PaymentDetailsForm) object;

    final Calendar start = parseDate(form.getStartMonth(), form.getStartYear());
    final Calendar expiration = parseDate(form.getExpiryMonth(), form.getExpiryYear());

    if (start != null && expiration != null && start.after(expiration)) {
        errors.rejectValue("startMonth", "payment.startDate.invalid");
    }//from  w ww  .  ja v  a  2 s. com

    final boolean editMode = StringUtils.isNotBlank(form.getPaymentId());
    if (editMode || Boolean.TRUE.equals(form.getNewBillingAddress())) {
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.titleCode", "address.title.invalid");
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.firstName",
                "address.firstName.invalid");
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.lastName",
                "address.lastName.invalid");
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.line1", "address.line1.invalid");
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.townCity",
                "address.townCity.invalid");
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.postcode",
                "address.postcode.invalid");
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.countryIso",
                "address.country.invalid");
        // ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.line2", "address.line2.invalid"); // for some addresses this field is required by cybersource
    }
}

From source file:br.com.etec.Main.java

private static void initLookAndFeel() {
    UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
}

From source file:com.assignment4.security.SaltFilter.java

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {

    // Assume its HTTP
    HttpServletRequest httpReq = (HttpServletRequest) request;

    // Check the user session for the salt cache, if none is present we create one
    Cache<String, Boolean> csrfPreventionSaltCache = (Cache<String, Boolean>) httpReq.getSession()
            .getAttribute("csrfPreventionSaltCache");

    if (csrfPreventionSaltCache == null) {
        csrfPreventionSaltCache = CacheBuilder.newBuilder().maximumSize(5000)
                .expireAfterWrite(20, TimeUnit.MINUTES).build();

        httpReq.getSession().setAttribute("csrfPreventionSaltCache", csrfPreventionSaltCache);
    }/*from w  ww.  ja v  a2 s.  c om*/

    // Generate the salt and store it in the users cache
    String salt = RandomStringUtils.random(20, 0, 0, true, true, null, new SecureRandom());
    csrfPreventionSaltCache.put(salt, Boolean.TRUE);

    // Add the salt to the current request so it can be used
    // by the page rendered in this request
    httpReq.setAttribute("randId", salt);

    chain.doFilter(request, response);
}

From source file:GUIUtils.java

/**
 * Make the passed internal frame a Tool Window.
 *///  ww w  .ja  va  2 s . c o m
public static void makeToolWindow(JInternalFrame frame, boolean isToolWindow) {
    if (frame == null) {
        throw new IllegalArgumentException("null JInternalFrame passed");
    }
    frame.putClientProperty("JInternalFrame.isPalette", isToolWindow ? Boolean.TRUE : Boolean.FALSE);
}