List of usage examples for org.apache.commons.lang BooleanUtils isNotTrue
public static boolean isNotTrue(Boolean bool)
Checks if a Boolean
value is not true
, handling null
by returning true
.
BooleanUtils.isNotTrue(Boolean.TRUE) = false BooleanUtils.isNotTrue(Boolean.FALSE) = true BooleanUtils.isNotTrue(null) = true
From source file:org.apache.ctakes.jdl.data.loader.CsvLoader.java
/** * @param loader//from w ww . j ava 2 s. c om * the loader to manage * @return the sql string */ public final String getSqlInsert(final CsvLoadType loader) { String query = "insert into " + loader.getTable() + " ("; String values = ") values ("; for (Column column : loader.getColumn()) { if (BooleanUtils.isNotTrue(column.isSkip())) { query += column.getName() + ","; values += "?,"; } } return StringUtils.removeEnd(query, ",") + StringUtils.removeEnd(values, ",") + ")"; }
From source file:org.broadleafcommerce.openadmin.security.BroadleafAdminAuthenticationFailureHandler.java
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { String failureUrlParam = StringUtil.cleanseUrlString(request.getParameter("failureUrl")); String successUrlParam = StringUtil.cleanseUrlString(request.getParameter("successUrl")); String failureUrl = failureUrlParam == null ? null : failureUrlParam.trim(); Boolean sessionTimeout = (Boolean) request.getAttribute("sessionTimeout"); if (StringUtils.isEmpty(failureUrl) && BooleanUtils.isNotTrue(sessionTimeout)) { failureUrl = defaultFailureUrl;//from ww w . ja va 2s. c o m } if (BooleanUtils.isTrue(sessionTimeout)) { failureUrl = "?sessionTimeout=true"; } //Grab url the user, was redirected from successUrlParam = request.getHeader("referer"); if (failureUrl != null) { if (!StringUtils.isEmpty(successUrlParam)) { if (!failureUrl.contains("?")) { failureUrl += "?successUrl=" + successUrlParam; } else { failureUrl += "&successUrl=" + successUrlParam; } } saveException(request, exception); getRedirectStrategy().sendRedirect(request, response, failureUrl); } else { super.onAuthenticationFailure(request, response, exception); } }
From source file:org.openhab.binding.unifi.internal.handler.UniFiControllerThingHandler.java
public @Nullable UniFiClient getClient(String cid, String site) { // mgb: first check active clients and fallback to insights if not found UniFiClient client = null;/*w ww.ja v a 2s . co m*/ // mgb: first check active clients and fallback to insights if not found client = cacheGet(clientsCache, cid); if (client == null) { client = cacheGet(insightsCache, cid); } // mgb: short circuit if (client == null || BooleanUtils.isNotTrue(client.isWireless()) || !belongsToSite(client, site)) { return null; } // mgb: instanceof check just for type / cast safety return (client instanceof UniFiWirelessClient ? (UniFiWirelessClient) client : null); }