Example usage for org.springframework.util Assert hasLength

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

Introduction

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

Prototype

@Deprecated
public static void hasLength(@Nullable String text) 

Source Link

Document

Assert that the given String is not empty; that is, it must not be null and not the empty String.

Usage

From source file:com.graphaware.importer.cache.BaseCaches.java

/**
 * {@inheritDoc}// ww  w  .  ja va  2  s  . c o  m
 */
@Override
public Cache getCache(String cacheName) {
    Assert.hasLength(cacheName);

    if (!caches.containsKey(cacheName)) {
        throw new IllegalStateException("Cache " + cacheName + " has not been created");
    }

    return caches.get(cacheName);
}

From source file:com.kodgemisi.common.thymeleaf.ThymeleafLayoutInterceptor.java

public void setViewAttributeName(String viewAttributeName) {
    Assert.hasLength(defaultLayout);
    this.viewAttributeName = viewAttributeName;
}

From source file:io.kahu.hawaii.util.logger.RequestLogBuilder.java

public RequestLogBuilder paramNull(String name) {
    Assert.hasLength(name);
    try {//from ww w.  j  a  va2  s. c om
        this.params.put(name, JSONObject.EXPLICIT_NULL);
    } catch (JSONException cant_happen) {
        //
    }
    return this;
}

From source file:io.kahu.hawaii.util.logger.RequestLogBuilder.java

public RequestLogBuilder param(String name, boolean value) {
    Assert.hasLength(name);
    try {/*from  w  ww  . j a va2  s.  co m*/
        this.params.put(name, value);
    } catch (JSONException cant_happen) {
        //
    }
    return this;
}

From source file:com.javaeeeee.entities.Bookmark.java

/**
 * A constructor to create a bookmark./*from  w  ww.  j av  a 2 s  .c  o  m*/
 *
 * @param url bookmark URL.
 * @param description bookmark description.
 */
public Bookmark(String url, String description) {
    Assert.hasLength(url);
    this.url = url;
    this.description = description;
}

From source file:com.erudika.para.security.JWTRestfulAuthFilter.java

public JWTRestfulAuthFilter(String defaultFilterProcessesUrl) {
    Assert.hasLength(defaultFilterProcessesUrl);
    setFilterProcessesUrl(defaultFilterProcessesUrl);
}

From source file:org.jcf.graphicMessage.GraphicObjectFactory.java

/**
 * creating new TextImpl object with new id and a list of locations
 * @param nikName Nikname inside room/* w w  w  .  j a va  2  s  .  co m*/
 * @param room name of the room
 * @param text text to diplay
 * @param loc Locatio of text
 * @return created Text Object
 */
public static Text createText(String nikName, String room, String text, Location loc) {
    Assert.hasLength(nikName);
    Assert.hasLength(room);
    Assert.hasLength(text);
    Assert.notNull(loc);

    Id id = IdFactory.getNextId(room, nikName);
    Text p = new TextImpl(id);
    p.addLocation(loc);
    p.setText(text);
    return p;
}

From source file:com.orange.cepheus.broker.SubscriptionsTest.java

@Test
public void addSubscriptionTest()
        throws URISyntaxException, SubscriptionException, SubscriptionPersistenceException {
    SubscribeContext subscribeContext = createSubscribeContextTemperature();
    String subscriptionId = subscriptions.addSubscription(subscribeContext);

    Assert.notNull(subscriptionId);// ww w.j  av a 2  s.co  m
    Assert.hasLength(subscriptionId);
    Assert.notNull(subscriptions.getSubscription(subscriptionId));
    Map<String, Subscription> subscriptions = subscriptionsRepository.getAllSubscriptions();
    Assert.isTrue(subscriptions.size() == 1);
    Assert.notNull(subscriptions.get(subscriptionId).getExpirationDate());
}

From source file:com.javaeeeee.entities.User.java

/**
 * A constructor used to create users./*from   www  .  j a va  2 s.com*/
 *
 * @param username
 * @param password
 */
public User(String username, String password) {
    Assert.hasLength(username);
    Assert.hasLength(password);
    this.username = username;
    this.password = password;
}

From source file:io.kahu.hawaii.util.logger.RequestLogBuilder.java

public RequestLogBuilder param(String name, int value) {
    Assert.hasLength(name);
    try {/*from  www .  j  a v  a2s.c o  m*/
        this.params.put(name, value);
    } catch (JSONException cant_happen) {
        //
    }
    return this;
}