Example usage for org.springframework.util Assert noNullElements

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

Introduction

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

Prototype

@Deprecated
public static void noNullElements(@Nullable Object[] array) 

Source Link

Document

Assert that an array contains no null elements.

Usage

From source file:org.opencredo.util.si.RoundRobinLoadBalancingRouter.java

public RoundRobinLoadBalancingRouter(MessageChannel[] channels) {
    Assert.noNullElements(channels);
    Assert.isTrue(channels.length > 0);
    this.channels = channels;
    this.ixLastChannel = 0;
}

From source file:net.eusashead.spring.gaecache.GaeCacheKey.java

public GaeCacheKey(ArgumentHash[] args) {
    Assert.notNull(args);
    Assert.notEmpty(args);
    Assert.noNullElements(args);
    this.hashes = args;
}

From source file:org.opencredo.twitter.si.FilterTwitterStreamConfiguration.java

public FilterTwitterStreamConfiguration(TwitterCredentials credentials, String[] followScreenNames,
        String[] trackKeywords, int numberOfHistoricStatusesToLoad) {
    super(credentials);

    Assert.notNull(followScreenNames);/*from   w  w w.  j  ava2 s  . c o m*/
    Assert.noNullElements(followScreenNames);

    this.followScreenNames = followScreenNames;
    this.trackKeywords = trackKeywords;
    this.numberOfHistoricStatusesToLoad = numberOfHistoricStatusesToLoad;
}

From source file:com.google.code.guice.repository.configuration.RepositoriesGroupBuilder.java

public static RepositoriesGroupBuilder forPackages(Collection<String> repositoriesPackages) {
    Assert.notEmpty(repositoriesPackages);
    Assert.noNullElements(repositoriesPackages.toArray(new String[repositoriesPackages.size()]));
    return new RepositoriesGroupBuilder(repositoriesPackages);
}

From source file:jp.xet.uncommons.spring.CompositeSaltSource.java

/**
 * ??/*  ww w.  j a v a 2s. c o  m*/
 * 
 * @param sources array of {@link SaltSource}
 * @param separator the separator character to use, {@code null} treated as ""
 * @throws IllegalArgumentException {@code sources}?{@code null}???
 */
public CompositeSaltSource(SaltSource[] sources, String separator) {
    Assert.noNullElements(sources);
    this.sources = sources.clone();
    this.separator = separator == null ? "" : separator;
}

From source file:it.reply.orchestrator.config.properties.OidcProperties.java

/**
 * Set the IAM properties.//w w w.  j  a v  a  2  s . c om
 * 
 * @param iamProperties
 *          the IAM properties to set
 */
public void setIamProperties(List<IamProperties> iamProperties) {
    Assert.notNull(iamProperties);
    Assert.noNullElements(iamProperties.toArray());
    this.iamProperties = iamProperties;
}

From source file:com.google.code.guice.repository.configuration.RepositoriesGroupBuilder.java

public RepositoriesGroupBuilder withPackages(Collection<String> repositoriesPackages) {
    Assert.noNullElements(repositoriesPackages.toArray(new String[repositoriesPackages.size()]));
    this.repositoriesPackages.addAll(repositoriesPackages);
    return this;
}

From source file:com.google.code.guice.repository.spi.TypeUtil.java

/**
 * Finds and returns class of specified generic parametrization class.
 *
 * @param aClass                generic class
 * @param genericParameterClass generic parametrization class
 *
 * @return parameter class or {@code null} if parameter can't be found
 *
 * @throws IllegalArgumentException if specified {@code aClass}  or {@code genericParameterClass} is null
 *//*from   w  ww.j  av a2  s  .  co  m*/
public static <T> Class<T> getTypeParameterClass(Class aClass, Class<T> genericParameterClass) {
    Assert.noNullElements(new Object[] { aClass, genericParameterClass });

    Collection<Type> types = new ArrayList<Type>();

    // check interfaces
    getGenericInterfacesActualTypes(types, aClass);

    Class result = findAppropriateType(types, genericParameterClass);
    if (result == null) {
        types.clear();
        // check superclasses
        getGenericSuperclassActualTypes(types, aClass);
    }
    return findAppropriateType(types, genericParameterClass);
}

From source file:com.ocs.dynamo.utils.ClassUtils.java

/**
 * Find constructor based on the types of the given arguments used to instantiate the class with
 * the found constructor/*w  ww.j  ava2  s .c  om*/
 * 
 * @param clazz
 * @param args
 * @return
 */
public static <T> Constructor<T> getConstructor(Class<T> clazz, Object... args) {
    Assert.notNull(clazz);
    Assert.noNullElements(args);
    Constructor<T> constructor = null;
    List<Class<?>> types = new ArrayList<Class<?>>();
    for (Object arg : args) {
        types.add(arg.getClass());
    }
    try {
        if (types.isEmpty()) {
            constructor = clazz.getConstructor();
        } else {
            constructor = clazz.getConstructor(types.toArray(new Class<?>[0]));
        }
    } catch (Exception e) {
        LOG.error(e.getMessage(), e);
    }
    return constructor;
}

From source file:org.lexevs.dao.database.service.RevisableAbstractDatabaseService.java

/**
 * Make change./*from w w  w .j av a 2  s. co  m*/
 * 
 * @param id the id
 * @param revisedEntry the revised entry
 * @param type the type
 * @param template the template
 * 
 * @throws LBException the LB exception
 */
protected void makeChange(I id, T revisedEntry, EntryStateType type, ChangeDatabaseStateTemplate<I, T> template)
        throws LBException {

    Assert.noNullElements(new Object[] { id, revisedEntry, type, template });

    String codingSchemeUri = id.getCodingSchemeUri();
    String version = id.getCodingSchemeVersion();

    CodingSchemeDao codingSchemeDao = getDaoManager().getCodingSchemeDao(codingSchemeUri, version);

    VersionsDao versionsDao = getDaoManager().getVersionsDao(codingSchemeUri, version);

    String codingSchemeUId = codingSchemeDao.getCodingSchemeUIdByUriAndVersion(codingSchemeUri, version);
    Assert.notNull(codingSchemeUId);

    String entryUId = getEntryUid(id, revisedEntry);
    Assert.notNull(entryUId, "The 'getEntryUid' method failed to produce the current Entry's Uid.");

    T currentEntry = getCurrentEntry(id, entryUId);
    Assert.notNull(currentEntry, "The 'getCurrentEntry' method failed to produce the current Entry.");

    String currentEntryStateUid = this.resolveCurrentEntryStateUid(id, entryUId, type);
    Assert.notNull(currentEntryStateUid);

    if (!this.isChangeTypeDependent(currentEntry) || this.isChangeTypeRemove(revisedEntry)) {
        this.insertIntoHistory(id, currentEntry, entryUId);
    }

    if (this.isChangeTypeRemove(revisedEntry)) {
        currentEntryStateUid = null;
    }

    String entryStateUId = template.doChange(id, entryUId, revisedEntry, type);

    /* register entrystate details for the entry.*/
    if (!this.isChangeTypeDependent(revisedEntry)) {
        versionsDao.insertEntryState(codingSchemeUId, entryStateUId, entryUId, type, currentEntryStateUid,
                revisedEntry.getEntryState());
    }

    /* apply dependent changes for the entry.*/
    this.doInsertDependentChanges(id, revisedEntry);
}