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:no.dusken.annonseweb.control.AnnonsePersonController.java

@RequestMapping("/doArchive/{user}")
public String archiveUser(@PathVariable AnnonsePerson user) {
    user.setActive(Boolean.FALSE);
    annonsePersonService.saveAndFlush(user);
    return "redirect:/annonseweb/user/all";
}

From source file:com.jsonstore.jackson.JsonOrgJSONArrayDeserializer.java

@Override
public JSONArray deserialize(JsonParser parser, DeserializationContext context)
        throws IOException, JsonProcessingException {
    JSONArray result = new JacksonSerializedJSONArray();
    JsonToken token = parser.nextToken();

    while (token != JsonToken.END_ARRAY) {
        switch (token) {
        case START_ARRAY: {
            result.put(deserialize(parser, context));

            break;
        }/*w  ww .  j  a v  a  2 s .  c  o  m*/

        case START_OBJECT: {
            result.put(JsonOrgJSONObjectDeserializer.instance.deserialize(parser, context));

            break;
        }

        case VALUE_EMBEDDED_OBJECT: {
            result.put(parser.getEmbeddedObject());

            break;
        }

        case VALUE_FALSE: {
            result.put(Boolean.FALSE);

            break;
        }

        case VALUE_NULL: {
            result.put(JSONObject.NULL);

            break;
        }

        case VALUE_NUMBER_FLOAT: {
            result.put(parser.getNumberValue());

            break;
        }

        case VALUE_NUMBER_INT: {
            result.put(parser.getNumberValue());

            break;
        }

        case VALUE_STRING: {
            result.put(parser.getText());

            break;
        }

        case VALUE_TRUE: {
            result.put(Boolean.TRUE);

            break;
        }

        case END_ARRAY:
        case END_OBJECT:
        case FIELD_NAME:
        case NOT_AVAILABLE: {
            break;
        }
        }

        token = parser.nextToken();
    }

    return result;
}

From source file:com.joe.utilities.core.startup.listener.AlineoContextListener.java

/**
 * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
 *//*from  w  w w.  ja  v a 2  s  .c  o  m*/
public void contextInitialized(ServletContextEvent event) {
    logger.info(".contextInitialized:  Entering");
    StartupValidator validator = new StartupValidator();
    ReturnStatus status = validator.validate();
    Boolean success = Boolean.TRUE;
    if (!status.isSuccess()) {
        success = Boolean.FALSE;
        event.getServletContext().setAttribute("Messages", status);
        event.getServletContext().setAttribute("Exception", validator.getStartupException());

    }
    event.getServletContext().setAttribute("Working", success);
    logger.info(".contextInitialized:  Exiting");
}

From source file:edu.stanford.muse.email.VerifyEmailSetup.java

public static Pair<Boolean, String> run() {
    PrintStream savedOut = System.out;
    InputStream savedIn = System.in;

    try {/*from   w w  w. j  a v  a2s .  c  o  m*/
        // Get a Properties object
        Properties props = System.getProperties();

        // Get a Session object
        Session session = Session.getInstance(props, null);
        session.setDebug(true);
        String filename = System.getProperty("java.io.tmpdir") + File.separatorChar + "verifyEmailSetup";
        PrintStream ps = new PrintStream(new FileOutputStream(filename));
        System.setOut(ps);
        System.setErr(ps);

        // Get a Store object
        Store store = null;
        store = session.getStore("imaps");
        store.connect("imap.gmail.com", 993, "checkmuse", ""); // not the real password. unfortunately, the checkmuse a/c will get blocked by google.
        //           Folder folder = store.getFolder("[Gmail]/Sent Mail");
        //           int totalMessages = folder.getMessageCount();
        // System.err.println (totalMessages + " messages!");
        ps.close();
        String contents = Util.getFileContents(filename);
        System.out.println(contents);
        return new Pair<Boolean, String>(Boolean.TRUE, contents);
    } catch (AuthenticationFailedException e) {
        /* its ok if auth failed. we only want to check if IMAPS network route is blocked.
         when network is blocked, we'll get something like
        javax.mail.MessagingException: No route to host; 
        nested exception is: 
        java.net.NoRouteToHostException: No route to host 
        ...
        */
        log.info("Verification succeeded: " + Util.stackTrace(e));
        return new Pair<Boolean, String>(Boolean.TRUE, "");
    } catch (Exception e) {
        log.warn("Verification failed: " + Util.stackTrace(e));
        return new Pair<Boolean, String>(Boolean.FALSE, e.toString()); // stack track reveals too much about our code... Util.stackTrace(e));         
    } finally {
        System.setOut(savedOut);
        System.setIn(savedIn);
    }
}

From source file:ch.rasc.extclassgenerator.ProxyObject.java

protected ProxyObject(ModelBean model, OutputConfig config) {
    if (StringUtils.hasText(model.getIdProperty()) && !model.getIdProperty().equals("id")) {
        this.idParam = model.getIdProperty();
    }/*from   w w w  . jav a2s  . c  om*/

    if (model.isDisablePagingParameters()) {
        Object value;
        if (config.getOutputFormat() == OutputFormat.EXTJS4) {
            value = "undefined";
        } else if (config.getOutputFormat() == OutputFormat.EXTJS5) {
            value = "";
        } else {
            value = Boolean.FALSE;
        }
        this.pageParam = value;
        this.startParam = value;
        this.limitParam = value;
    }

    Map<String, Object> readerConfigObject = new LinkedHashMap<String, Object>();

    if (StringUtils.hasText(model.getReader()) && !"json".equals(model.getReader())) {
        readerConfigObject.put("type", model.getReader());
    }

    String rootPropertyName = config.getOutputFormat() == OutputFormat.EXTJS4 ? "root" : "rootProperty";

    if (StringUtils.hasText(model.getRootProperty())) {
        readerConfigObject.put(rootPropertyName, model.getRootProperty());
    } else if (model.isPaging()) {
        readerConfigObject.put(rootPropertyName, "records");
    }

    if (StringUtils.hasText(model.getMessageProperty())) {
        readerConfigObject.put("messageProperty", model.getMessageProperty());
    }

    if (StringUtils.hasText(model.getTotalProperty())) {
        readerConfigObject.put("totalProperty", model.getTotalProperty());
    }

    if (StringUtils.hasText(model.getSuccessProperty())) {
        readerConfigObject.put("successProperty", model.getSuccessProperty());
    }

    if (!readerConfigObject.isEmpty()) {
        this.reader = readerConfigObject;
    }

    Map<String, Object> writerConfigObject = new LinkedHashMap<String, Object>();

    if (StringUtils.hasText(model.getWriter()) && !"json".equals(model.getWriter())) {
        writerConfigObject.put("type", model.getWriter());
    }

    if (model.getWriteAllFields() != null
            && (config.getOutputFormat() == OutputFormat.EXTJS5 && model.getWriteAllFields()
                    || !model.getWriteAllFields() && (config.getOutputFormat() == OutputFormat.EXTJS4
                            || config.getOutputFormat() == OutputFormat.TOUCH2))) {
        writerConfigObject.put("writeAllFields", model.getWriteAllFields());
    }

    if (config.getOutputFormat() == OutputFormat.EXTJS5 && model.isClientIdPropertyAddToWriter()
            && StringUtils.hasText(model.getClientIdProperty())) {
        writerConfigObject.put("clientIdProperty", model.getClientIdProperty());
    }

    if (!writerConfigObject.isEmpty()) {
        this.writer = writerConfigObject;
    }

    boolean hasApiMethods = false;
    ApiObject apiObject = new ApiObject();

    if (StringUtils.hasText(model.getCreateMethod())) {
        hasApiMethods = true;
        apiObject.create = model.getCreateMethod();
    }
    if (StringUtils.hasText(model.getUpdateMethod())) {
        hasApiMethods = true;
        apiObject.update = model.getUpdateMethod();
    }
    if (StringUtils.hasText(model.getDestroyMethod())) {
        hasApiMethods = true;
        apiObject.destroy = model.getDestroyMethod();
    }

    if (StringUtils.hasText(model.getReadMethod())) {
        if (hasApiMethods) {
            apiObject.read = model.getReadMethod();
        } else {
            this.directFn = model.getReadMethod();
        }
    }

    if (hasApiMethods) {
        this.api = apiObject;
    }
}

From source file:com.janrain.backplane.server.BackplaneMessage.java

public BackplaneMessage(String bus, String channel, int defaultExpireSeconds, int maxExpireSeconds,
        Map<String, Object> data) throws BackplaneServerException, SimpleDBException {
    Map<String, String> d = new LinkedHashMap<String, String>(toStringMap(data));
    String id = generateMessageId(new Date());
    d.put(Field.ID.getFieldName(), id);
    d.put(Field.BUS.getFieldName(), bus);
    d.put(Field.CHANNEL_NAME.getFieldName(), channel);
    d.put(Field.PAYLOAD.getFieldName(), extractFieldValueAsJsonString(Field.PAYLOAD, data));
    Object sticky = data.get(Field.STICKY.getFieldName());
    d.put(Field.STICKY.getFieldName(), sticky != null ? sticky.toString() : Boolean.FALSE.toString());
    d.put(Field.EXPIRE.getFieldName(), DateTimeUtils.processExpireTime(sticky,
            data.get(Field.EXPIRE.getFieldName()), defaultExpireSeconds, maxExpireSeconds));
    super.init(id, d);
}

From source file:com.inkubator.hrm.web.payroll.UnregSalaryFormController.java

@PostConstruct
@Override//from  w  w  w  . ja  v  a  2  s  .co m
public void initialization() {
    super.initialization();
    try {
        String unregSalaryId = FacesUtil.getRequestParameter("unregSalaryId");
        model = new UnregSalaryModel();
        isUpdate = Boolean.FALSE;
        //dropdown base period bulan
        dropDownMonths = new HashMap<String, Integer>();
        for (int i = 1; i < 13; i++) {
            dropDownMonths.put(MonthAsStringUtil.getMonth(i), i);
        }
        dropDownYears = wtPeriodeService.getAllYears();

        dropDownMonths = HashMapSortByValueUtil.sortByValues(dropDownMonths);
        if (StringUtils.isNotEmpty(unregSalaryId)) {
            UnregSalary unregSalary = unregSalaryService.getEntiyByPK(Long.parseLong(unregSalaryId));
            if (unregSalaryId != null) {
                WtPeriode wtPeriode = wtPeriodeService.getEntiyByPK(unregSalary.getWtPeriode().getId());
                model = getModelFromEntity(unregSalary, wtPeriode);
                isUpdate = Boolean.TRUE;
            }
        }

    } catch (Exception e) {
        LOGGER.error("Error", e);
    }
}

From source file:org.openvoters.android.tasks.RemoteAPIVoteTask.java

@Override
protected Boolean doInBackground(Object... params) {
    callback = (RemoteAPIVoteCallback) params[0];
    Item party = (Item) params[1];// w  w  w.  j a v a2s.com
    uniqueVoterID = (String) params[2];

    try {
        String remoteAPIURL = String.format("%s/%s", RemoteAPI.getBaseURL(), "vote");
        makeRequest(remoteAPIURL, party, uniqueVoterID);
        return Boolean.TRUE;

    } catch (Exception e) {
        Log.e("Remote API", String.format("Errore (%s): %s", e, e.getLocalizedMessage()));

        e.printStackTrace();
        exc = e;
        return Boolean.FALSE;
    }
}

From source file:net.sf.gazpachoquest.qbe.RangeSpecification.java

public static <E, D extends Comparable<? super D>> Specification<E> toSpecification(final Range<E, D> range) {
    Validate.isTrue(range.isSet(), "You must pass an exploitable range");
    return new Specification<E>() {
        @Override//from   w  w  w .ja  v  a2 s .c  o  m
        public Predicate toPredicate(final Root<E> root, final CriteriaQuery<?> query,
                final CriteriaBuilder builder) {
            Predicate rangePredicate = null;

            if (range.isBetween()) {
                rangePredicate = builder.between(root.get(range.getField()), range.getFrom(), range.getTo());
            } else if (range.isFromSet()) {
                // rangePredicate =
                // builder.greaterThanOrEqualTo(root.get(range.getField()),
                // range.getFrom());
                rangePredicate = builder.greaterThan(root.get(range.getField()), range.getFrom());
            } else if (range.isToSet()) {
                // rangePredicate =
                // builder.lessThanOrEqualTo(root.get(range.getField()),
                // range.getTo());
                rangePredicate = builder.lessThan(root.get(range.getField()), range.getTo());
            }

            if (rangePredicate != null) {
                if (!range.isIncludeNullSet() || Boolean.FALSE.equals(range.getIncludeNull())) {
                    return rangePredicate;
                } else {
                    return builder.or(rangePredicate, builder.isNull(root.get(range.getField())));
                }
            }

            // no range at all
            // take the opportunity to keep only null...
            if (Boolean.TRUE.equals(range.getIncludeNull())) {
                return builder.isNull(root.get(range.getField()));
            }

            // ... or non-null only...
            if (Boolean.FALSE.equals(range.getIncludeNull())) {
                return builder.isNotNull(root.get(range.getField()));
            }

            throw new IllegalStateException("You must pass an exploitable range (should not happen here)");
        }
    };
}

From source file:com.couchbase.lite.DocumentTest.java

public void testNewDocumentHasCurrentRevision() throws CouchbaseLiteException {
    Document document = database.createDocument();
    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put("foo", "foo");
    properties.put("bar", Boolean.FALSE);
    document.putProperties(properties);/* w  w w  .j a v a  2 s  . c om*/
    Assert.assertNotNull(document.getCurrentRevisionId());
    Assert.assertNotNull(document.getCurrentRevision());
}