@Override public boolean isPasswordChangeRequired() { return BooleanUtils.toBoolean(passwordChangeRequired); }
@Override public boolean isDeactivated() { return BooleanUtils.toBoolean(deactivated); }
/** * 是否启用Unsafe功能 * * @return unsafe.enable */ public boolean isEnableUnsafe() { return BooleanUtils.toBoolean(featureMap.get(KEY_UNSAFE_ENABLE)); }
/** * 是否启用事件池 * * @return event.pool.enable */ public boolean isEventPoolEnable() { return BooleanUtils.toBoolean(featureMap.get(KEY_EVENT_POOL_ENABLE)); }
@Override public void init(FilterConfig filterConfig) { logger.info("------------ xss filter init ------------"); String isIncludeRichText = filterConfig.getInitParameter("isIncludeRichText"); if (StringUtils.isNotBlank(isIncludeRichText)) { flag = BooleanUtils.toBoolean(isIncludeRichText); } String temp = filterConfig.getInitParameter("excludes"); if (temp != null) { String[] url = temp.split(","); excludes.addAll(Arrays.asList(url)); } }
/** * Used for linking in toOneLookup fields as well as linking to the entity via a 'name' field */ public boolean getCanLinkToExternalEntity() { boolean isAddlFK = SupportedFieldType.ADDITIONAL_FOREIGN_KEY.toString().equals(fieldType); boolean canLinkToExternalEntity = BooleanUtils.toBoolean(this.canLinkToExternalEntity); return isAddlFK && canLinkToExternalEntity; }
public void setConfigAttributes(Object attributes) { Map attributeMap = (Map) attributes; this.name = (String) attributeMap.get(EnvironmentVariableConfig.NAME); String value = (String) attributeMap.get(EnvironmentVariableConfig.VALUE); if (StringUtils.isBlank(name) && StringUtils.isBlank(value)) { throw new IllegalArgumentException(String.format("Need not null/empty name & value %s:%s", this.name, value)); } this.isSecure = BooleanUtils.toBoolean((String) attributeMap.get(EnvironmentVariableConfig.SECURE)); Boolean isChanged = BooleanUtils.toBoolean((String) attributeMap.get(EnvironmentVariableConfig.ISCHANGED)); if (isSecure) { this.encryptedValue = isChanged ? new EncryptedVariableValueConfig(encrypt(value)) : new EncryptedVariableValueConfig(value); } else { this.value = new VariableValueConfig(value); } }
@Test(expected = IllegalArgumentException.class) public void test_toBoolean_Integer_Integer_Integer_nullValue() { BooleanUtils.toBoolean(null, Integer.valueOf(6), Integer.valueOf(7)); }
@Test public void test_toBoolean_String_String_String() { assertTrue(BooleanUtils.toBoolean(null, null, "N")); assertFalse(BooleanUtils.toBoolean(null, "Y", null)); assertTrue(BooleanUtils.toBoolean("Y", "Y", "N")); assertTrue(BooleanUtils.toBoolean("Y", new String("Y"), new String("N"))); assertFalse(BooleanUtils.toBoolean("N", "Y", "N")); assertFalse(BooleanUtils.toBoolean("N", new String("Y"), new String("N"))); assertTrue(BooleanUtils.toBoolean((String) null, null, null)); assertTrue(BooleanUtils.toBoolean("Y", "Y", "Y")); assertTrue(BooleanUtils.toBoolean("Y", new String("Y"), new String("Y"))); }
@Test(expected = IllegalArgumentException.class) public void test_toBoolean_int_int_int_noMatch() { BooleanUtils.toBoolean(8, 6, 7); }
@Test(expected = IllegalArgumentException.class) public void test_toBoolean_Integer_Integer_Integer_noMatch() { BooleanUtils.toBoolean(Integer.valueOf(8), Integer.valueOf(6), Integer.valueOf(7)); }
@Test(expected = IllegalArgumentException.class) public void test_toBoolean_String_String_String_nullValue() { BooleanUtils.toBoolean(null, "Y", "N"); }
@Test(expected = IllegalArgumentException.class) public void test_toBoolean_String_String_String_noMatch() { BooleanUtils.toBoolean("X", "Y", "N"); }
@Test public void test_toBoolean_Integer_Integer_Integer() { final Integer six = Integer.valueOf(6); final Integer seven = Integer.valueOf(7); assertTrue(BooleanUtils.toBoolean(null, null, seven)); assertFalse(BooleanUtils.toBoolean(null, six, null)); assertTrue(BooleanUtils.toBoolean(Integer.valueOf(6), six, seven)); assertFalse(BooleanUtils.toBoolean(Integer.valueOf(7), six, seven)); }
protected boolean areSingleBranchTasksSynchronous(TaskContext taskContext) { return BooleanUtils.toBoolean(taskContext.getTaskState() .getProp(TaskConfigurationKeys.TASK_IS_SINGLE_BRANCH_SYNCHRONOUS, TaskConfigurationKeys.DEFAULT_TASK_IS_SINGLE_BRANCH_SYNCHRONOUS)); }
@Http("/flush") public void flush(final HttpServletRequest req, final HttpServletResponse resp) throws ModuleException, IOException { final String isForceString = getParamWithDefault(req, "force", EMPTY); final boolean isForce = BooleanUtils.toBoolean(isForceString); moduleManager.flush(isForce); output(resp.getWriter(), "module flush finished, total=%s;", moduleManager.list().size()); }
private IpAddress getIPAddress(HttpServletRequest request) { String ip = WebUtils.required(request, "ip"); String port = WebUtils.required(request, "port"); String weight = WebUtils.optional(request, "weight", "1"); String cluster = WebUtils.optional(request, "cluster", StringUtils.EMPTY); if (StringUtils.isEmpty(cluster)) { cluster = WebUtils.optional(request, "clusterName", UtilsAndCommons.DEFAULT_CLUSTER_NAME); } boolean enabled = BooleanUtils.toBoolean(WebUtils.optional(request, "enable", "true")); IpAddress ipAddress = new IpAddress(); ipAddress.setPort(Integer.parseInt(port)); ipAddress.setIp(ip); ipAddress.setWeight(Double.parseDouble(weight)); ipAddress.setClusterName(cluster); ipAddress.setEnabled(enabled); return ipAddress; }