Example usage for org.springframework.util Assert notEmpty

List of usage examples for org.springframework.util Assert notEmpty

Introduction

In this page you can find the example usage for org.springframework.util Assert notEmpty.

Prototype

@Deprecated
public static void notEmpty(@Nullable Map<?, ?> map) 

Source Link

Document

Assert that a Map contains entries; that is, it must not be null and must contain at least one entry.

Usage

From source file:org.openlegacy.designtime.analyzer.support.CharReplaceTranslator.java

@Override
public void afterPropertiesSet() throws Exception {
    Assert.notEmpty(charsToReplace);
}

From source file:org.pentaho.platform.repository2.unified.jcr.DefaultPermissionConversionHelper.java

public Privilege[] pentahoPermissionsToPrivileges(final Session session,
        final EnumSet<RepositoryFilePermission> permissions) throws RepositoryException {
    Assert.notNull(session);/*from  w  w  w. j av  a2 s .  co m*/
    Assert.notNull(permissions);
    Assert.notEmpty(permissions);

    Set<Privilege> privileges = new HashSet<Privilege>();

    for (RepositoryFilePermission currentPermission : permissions) {
        if (permissionEnumToPrivilegeNamesMap.containsKey(currentPermission)) {
            Collection<String> privNames = permissionEnumToPrivilegeNamesMap.get(currentPermission);
            for (String privName : privNames) {
                privileges.add(session.getAccessControlManager().privilegeFromName(privName));
            }
        } else {
            logger.debug("skipping permission=" + currentPermission //$NON-NLS-1$
                    + " as it doesn't have any corresponding privileges"); //$NON-NLS-1$
        }
    }

    Assert.isTrue(!privileges.isEmpty(), "no privileges; see previous 'skipping permission' messages");

    return privileges.toArray(new Privilege[0]);
}

From source file:org.springframework.boot.actuate.autoconfigure.ShellProperties.java

public void setDisabledCommands(String[] disabledCommands) {
    Assert.notEmpty(disabledCommands);
    this.disabledCommands = disabledCommands;
}

From source file:org.springframework.boot.actuate.autoconfigure.ShellProperties.java

public void setDisabledPlugins(String[] disabledPlugins) {
    Assert.notEmpty(disabledPlugins);
    this.disabledPlugins = disabledPlugins;
}

From source file:org.springframework.cache.interceptor.YJFCacheAspectSupport.java

/**
 * Set one or more cache operation sources which are used to find the cache
 * attributes. If more than one source is provided, they will be aggregated using a
 * {@link CompositeCacheOperationSource}.
 * @param cacheOperationSources must not be {@code null}
 *//* w  w w  . j a v  a2  s  . com*/
public void setCacheOperationSources(CacheOperationSource... cacheOperationSources) {
    Assert.notEmpty(cacheOperationSources);
    this.cacheOperationSource = (cacheOperationSources.length > 1
            ? new CompositeCacheOperationSource(cacheOperationSources)
            : cacheOperationSources[0]);
}

From source file:org.springframework.integration.splunk.support.SplunkServiceFactory.java

/**
 * @param splunkServers the {@code List<SplunkServer>} to build this {@code SplunkServiceFactory}
 * @since 1.1/* ww  w .j a  v  a2 s.co  m*/
 */
public SplunkServiceFactory(List<SplunkServer> splunkServers) {
    Assert.notEmpty(splunkServers);
    this.splunkServers = new ArrayList<SplunkServer>(splunkServers);
}

From source file:org.springframework.ldap.transaction.compensating.LdapTransactionUtils.java

/**
 * Get the first parameter in the argument list as a Name.
 * /*from w  ww  .j a va2 s.c o  m*/
 * @param args
 *            arguments supplied to a ldap operation.
 * @return a Name representation of the first argument, or the Name itself
 *         if it is a name.
 */
public static Name getFirstArgumentAsName(Object[] args) {
    Assert.notEmpty(args);

    Object firstArg = args[0];
    return getArgumentAsName(firstArg);
}

From source file:org.springframework.ldap.transaction.compensating.RenameOperationRecorder.java

public CompensatingTransactionOperationExecutor recordOperation(Object[] args) {
    log.debug("Storing rollback information for rename operation");
    Assert.notEmpty(args);
    if (args.length != 2) {
        // This really shouldn't happen.
        throw new IllegalArgumentException("Illegal argument length");
    }//from   w w w . j a v a 2s  .  c o  m
    Name oldDn = LdapTransactionUtils.getArgumentAsName(args[0]);
    Name newDn = LdapTransactionUtils.getArgumentAsName(args[1]);
    return new RenameOperationExecutor(ldapOperations, oldDn, newDn);
}