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

public static void notEmpty(@Nullable Map<?, ?> map, Supplier<String> messageSupplier) 

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:gov.nyc.doitt.gis.geoclient.parser.regex.PatternUtils.java

public static String literalMatchGroup(Collection<String> strings) {
    Assert.notEmpty(strings, "Collection of strings argument cannot be empty or null");
    StringBuffer buff = new StringBuffer("(");
    for (String s : strings) {
        buff.append(s);//from www. j  av a2s. c  o m
        buff.append("|");
    }
    buff.deleteCharAt(buff.lastIndexOf("|"));
    buff.append(")");
    return buff.toString();
}

From source file:org.hdiv.config.annotation.ParamExclusionRegistration.java

public ParamExclusionRegistration(String[] parameterPatterns) {
    Assert.notEmpty(parameterPatterns, "Parameter names pattern are required to create a exclusion.");
    this.parameterPatterns = parameterPatterns;
}

From source file:org.hdiv.config.annotation.UrlExclusionRegistration.java

public UrlExclusionRegistration(String[] urlPatterns) {
    Assert.notEmpty(urlPatterns, "A URL path is required to create a start page.");
    this.urlPatterns = urlPatterns;
}

From source file:org.hdiv.config.annotation.LongLivingPagesRegistration.java

public LongLivingPagesRegistration(String[] urlPatterns) {
    Assert.notEmpty(urlPatterns, "A URL path is required to create a start page.");
    this.urlPatterns = urlPatterns;
}

From source file:com.fns.grivet.query.Constraint.java

public Constraint(String[] constraintParts) {
    Assert.notEmpty(constraintParts, "Constraint parts must not be null or empty!");
    Assert.isTrue(constraintParts.length >= 3, "Must have 3 or more constraint parts!");
    attributeName = constraintParts[0];//from w  w  w .  j a v  a 2 s.c  om
    operator = Operator.fromValue(constraintParts[1]);
    values = constraintParts[2].split("\\s*,\\s*");
    if (operator.equals(Operator.BETWEEN)) {
        Assert.isTrue(values.length == 2, "Operator [between] requires two values!");
    }
    if (constraintParts.length == 4) {
        if (constraintParts[3] == null) {
            conjunction = null;
        } else {
            conjunction = Conjunction.fromValue(constraintParts[3]);
        }
    } else {
        conjunction = null;
    }
}

From source file:com.github.springtestdbunit.DatabaseConnections.java

public DatabaseConnections(String[] names, IDatabaseConnection[] connections) {
    Assert.notEmpty(names, "Names must not be empty");
    Assert.notEmpty(connections, "Connections must not be empty");
    Assert.isTrue(names.length == connections.length, "Names and Connections must have the same length");
    this.names = names;
    this.connections = connections;
}

From source file:com.appdynamics.cloudfoundry.appdservicebroker.catalog.Cost.java

Map<String, Double> getAmount() {
    synchronized (this.monitor) {
        Assert.notEmpty(this.amount, "Costs must specify at least one amount");
        return this.amount;
    }//  w  w w .  jav  a 2  s .  co m
}

From source file:at.porscheinformatik.common.spring.web.extended.locale.LocaleHandlerInterceptor.java

public LocaleHandlerInterceptor(List<LocaleSource> sources) {
    super();//  w ww. j ava  2 s .  c  o  m
    Assert.notEmpty(sources, "LocaleSources must not be empty");
    this.sources = sources;
}

From source file:demo.model.SimulatorFixture.java

public void setGpsSimulatorRequests(List<GpsSimulatorRequest> gpsSimulatorRequests) {
    Assert.notEmpty(gpsSimulatorRequests, "gpsSimulatorRequests must not be empty.");
    this.gpsSimulatorRequests = gpsSimulatorRequests;
}

From source file:org.hdiv.config.annotation.LongLivingPagesRegistry.java

/**
 * <p>//from w  w w .  j  ava  2  s  . co m
 * Configure one or more long living pages adding one or more url patterns.
 * </p>
 * <p>
 * Links and forms inside a long living pages never expire.
 * </p>
 * 
 * @param urlPatterns
 *            Url patterns.
 * @return more configuration options
 */
public LongLivingPagesRegistration addLongLivingPages(String... urlPatterns) {
    Assert.notEmpty(urlPatterns, "Url patterns are required");
    LongLivingPagesRegistration registration = new LongLivingPagesRegistration(urlPatterns);
    registrations.add(registration);
    return registration;
}