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:org.jcf.JCFFactory.java

/**
 * creates new Graphic Object Handler for room room and for nikname nikname
 * normally this is not used. a graphic object handler is created by JCFMultiUserChat
 * @param nikName users nikname in room//  w w w . j  a va2  s.c  o m
 * @param room muti user chat room name
 * @return the newly created GraphicObjectHandler
 */
public static GraphicObjectHandler newGraphicObjectHandler(String nikName, String room) {
    Assert.hasLength(nikName);
    Assert.hasLength(room);

    return new GraphicObjectHandlerImpl(nikName, room);
}

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

/**
 * get new id (as a new Object) for an existing or new room
 * @param room string as a room id//  w w w.j  ava2  s .c  o m
 * @return new and incremented id
 */
static Id getNextId(String room, String nikName) {
    Assert.hasLength(room);
    Assert.hasLength(nikName);

    Id id;
    synchronized (ids) {
        id = ids.get(room);
        if (id == null) {
            id = new Id(nikName);
            ids.put(room, id);
        }
    }
    return new Id(id.inc());
}

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

/**
 * created object based on type of given go
 * @param go given GeographicObject//from  w w  w .ja va  2s.com
 * @param nikName nikanme to use
 * @param room room name to use
 * @param locs list of locations
 * @return copy of geographic object with new id
 */
public static GraphicObject create(GraphicObject go, String nikName, String room, List<Location> locs) {
    Assert.notNull(go);
    Assert.hasLength(nikName);
    Assert.hasLength(room);
    Assert.notNull(locs);

    if (go instanceof Point) {
        return createPoint(nikName, room, locs.get(0));
    }
    if (go instanceof Line) {
        return createLine(nikName, room, locs);
    }
    if (go instanceof Polygon) {
        return createPolygon(nikName, room, locs);
    }
    if (go instanceof Text) {
        Text t = (Text) go;
        return createText(nikName, room, t.getText(), locs.get(0));
    }
    throw new JCFException("Unsupported GraphicObject");
}

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

public TestHeaderImpl(String name, String value) {
    super(name, value);
    Assert.hasLength(name);
    Assert.hasLength(value);
}

From source file:org.jcf.JCFFactory.java

/**
 * creates new instance of a connection class
 * @param jabberServer chatserver name//ww w  .  j  a  v  a  2 s. c om
 * @param userName username in chatserver to connect
 * @param passwd password on chatserver
 * @return instance of JCFConnection
 */
public static JCFConnection newJCFConnection(String jabberServer, String userName, String passwd) {
    Assert.hasLength(jabberServer);
    Assert.hasLength(userName);
    Assert.hasLength(passwd);

    return new ConnectionImpl(jabberServer, userName, passwd);
}

From source file:com.aaj.frontend.bu.UserManagerTest.java

@Test
public void test3() {
    log.info("starting test3 ...");
    Assert.hasLength("test");
}

From source file:com.acc.storefront.filters.btg.support.impl.DefaultUrlParsingStrategy.java

/**
 * @param regex/*from   w ww .j  av  a2s.co  m*/
 *           the regex to set
 */
public void setRegex(final String regex) {
    Assert.hasLength(regex);
    this.regex = regex;
}

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

/**
 * c-tor to use
 * @param nikName
 */
public Id(String nikName) {
    Assert.hasLength(nikName);
    this.nikName = nikName;
}

From source file:com.audi.interview.booking.service.VehicleService.java

public Vehicle findByLicensePlate(String licensePlate) {
    Assert.hasLength(licensePlate);
    return vehicleRepository.findByLicensePlate(licensePlate);
}