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:com.stitchgalaxy.domain.service.SitchGalaxyService.java

@Transactional(rollbackFor = Exception.class)
public void addProduct() {
    Product p = new Product();
    p.setBlocked(Boolean.TRUE);
    p.setPrice(BigDecimal.ZERO);//from ww w  . ja  v  a 2  s .co  m
    p.setDate(new LocalDate(2014, 1, 1));
    productRepository.save(p);
}

From source file:Main.java

private static Boolean parseBoolean(String s) throws IllegalArgumentException {
    if ("1".equals(s) || "true".equalsIgnoreCase(s)) {
        return Boolean.TRUE;
    } else if ("0".equals(s) || "false".equalsIgnoreCase(s)) {
        return Boolean.FALSE;
    }//from w  w w  .ja v  a2s  .  c  o m
    throw new IllegalArgumentException("Expected boolean, got " + s);
}

From source file:com.vsmjsc.rdgt.task.ListenCodeVerifier.java

@Override
protected Boolean doInBackground(Void... params) {
    HttpGet httpget = new HttpGet();
    try {/*from w  w w  .j  a v a2s.  c o m*/
        HttpResponse response = httpget.getDataInputStreamFromUrl(
                String.format("http://api.radio18plus.radito.com/1.0/license/check/%s", RadioCode));
        if (response != null && response.getHttpCode() == 200) {
            int status = new JSONObject(response.getContent()).getInt("status");
            if (status == 200) {
                return Boolean.TRUE;
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return Boolean.FALSE;
}

From source file:com.articulate.sigma.nlp.CorefSubstitutorLargeTest.java

@Parameterized.Parameters(name = "{2}{0}")
public static Collection<Object[]> prepare() {

    return JsonReader.transform("miscellaneous/corefsSubstitution.json", (JSONObject jo) -> {

        String input = (String) jo.get("in");
        String expected = (String) jo.get("out");
        String prefix = "";
        if (Boolean.TRUE.equals(jo.get("failed"))) {
            prefix = " ";
        }/*from   ww  w .  j av  a  2  s .  com*/

        return new Object[] { input, expected, prefix };
    });
}

From source file:com.aaj.frontend.bu.UserManagerTest.java

@Test
public void test1() {
    log.info("starting test1 ...");
    //Assert.notNull(null);
    Assert.isTrue(Boolean.TRUE);
}

From source file:io.lavagna.web.helper.UserSession.java

public static boolean isUserAuthenticated(HttpServletRequest req) {
    return Boolean.TRUE.equals(req.getSession().getAttribute(AUTH_KEY));
}

From source file:com.jonak.service.UserServiceImp.java

@Override
public Boolean deleteUser(int userId) {
    return Boolean.TRUE;
}

From source file:jobhunter.controllers.PreferencesController.java

public static void init() {

    Boolean isFirstTime = Boolean.TRUE;

    try {// www  . j  a  va2s .c  o m
        isFirstTime = getCurrent().keys().length == 0;
    } catch (BackingStoreException e) {
        l.error("Error loading preferences file", e);
    }

    if (isFirstTime) {
        l.debug("First time we run. Create default configuration");
        generate();
    }

}

From source file:Main.java

public static void makeTransient(Class<?> beanClass, String... pdNames) {
    try {/*  www . ja  va 2 s  .c om*/
        BeanInfo info = Introspector.getBeanInfo(beanClass);
        PropertyDescriptor[] descs = info.getPropertyDescriptors();
        if (descs == null) {
            throw new RuntimeException("Cannot access property descriptor for class " + beanClass);
        }
        Map<String, PropertyDescriptor> mapping = new HashMap<String, PropertyDescriptor>();
        for (PropertyDescriptor desc : descs) {
            mapping.put(desc.getName(), desc);
        }
        for (String pdName : pdNames) {
            PropertyDescriptor desc = mapping.get(pdName);
            if (desc == null) {
                throw new RuntimeException("Property " + pdName + " does not exist in " + beanClass);
            }
            desc.setValue("transient", Boolean.TRUE);
        }
    } catch (IntrospectionException ie) {
        throw new RuntimeException(ie);
    }
}

From source file:onlineBoutique.service.PaiementService.java

public void payer(long id) throws CommandeNulleException {

    Commande c = commandeService.findOne(id);

    if (c.getSousCommandes().isEmpty()) {
        throw new CommandeNulleException("Votre panier est vide");
    } else {/*from  w w w.j av  a  2s . c  o m*/
        //Paiement
        c.setCommandePaye(Boolean.TRUE);

        //Gestion de stock
        for (SousComande sousComande : c.getSousCommandes()) {
            //                sousComande.getArticle().getStock()
            //                articleService.findByArticleOrderBynom(c.getSousCommandes);
        }
        System.out.println("Votre paiement  t bien effectu");

    }

}