Java Code Examples for org.apache.commons.lang3.BooleanUtils#or()

The following examples show how to use org.apache.commons.lang3.BooleanUtils#or() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PortalJspBean.java    From lutece-core with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private static String checkSendParams( String strSend, String strSenderEmail, String strSenderName, String strSenderFirstName, String strReceipientEmail,
        String strContent, Locale locale )
{
    String strError = null;
    // If the form was submited, we check data
    if ( strSend != null )
    {
        boolean [ ] conditions = new boolean [ ] {
                StringUtils.isBlank( strSenderEmail ), StringUtils.isBlank( strSenderName ), StringUtils.isBlank( strSenderFirstName ),
                StringUtils.isBlank( strReceipientEmail ), StringUtils.isBlank( strContent )
        };

        if ( BooleanUtils.or( conditions ) )
        {
            strError = I18nService.getLocalizedString( MESSAGE_ERROR_MANDATORY_FIELDS, locale );
        }

        if ( ( strError != null ) && ( !AdminUserService.checkEmail( strSenderEmail ) || !AdminUserService.checkEmail( strReceipientEmail ) ) )
        {
            strError = I18nService.getLocalizedString( MESSAGE_ERROR_WRONG_SENDER_EMAIL, locale );
        }
    }
    return strError;
}
 
Example 2
Source File: PageService.java    From lutece-core with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private boolean isPortletVisible( HttpServletRequest request, Portlet portlet, int nMode )
{
    if ( ( nMode != MODE_ADMIN ) && ( portlet.getStatus( ) == Portlet.STATUS_UNPUBLISHED ) )
    {
        return false;
    }

    String strRole = portlet.getRole( );
    boolean bUserInRole = SecurityService.isAuthenticationEnable( ) ? SecurityService.getInstance( ).isUserInRole( request, strRole ) : true;

    boolean [ ] conditions = new boolean [ ] {
        strRole.equals( Page.ROLE_NONE ),                   // No role is required so the portlet is visible for anyone
        !SecurityService.isAuthenticationEnable( ),         // No authentication
        nMode == MODE_ADMIN,                                // We are in Admin mode, so all the portlet should be visible  
        bUserInRole                                         // The authentication is ON and the user get the role  
    };

    return BooleanUtils.or( conditions );
}
 
Example 3
Source File: BooleanUtil.java    From vjtools with Apache License 2.0 4 votes vote down vote up
/**
 * 多个值的or
 */
public static boolean or(final boolean... array) {
	return BooleanUtils.or(array);
}
 
Example 4
Source File: BooleanUtil.java    From vjtools with Apache License 2.0 4 votes vote down vote up
/**
 * 多个值的or
 */
public static boolean or(final boolean... array) {
	return BooleanUtils.or(array);
}
 
Example 5
Source File: BooleanUtil.java    From j360-dubbo-app-all with Apache License 2.0 4 votes vote down vote up
/**
 * 多个值的or
 */
public static boolean or(final boolean... array) {
	return BooleanUtils.or(array);
}