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:de.escalon.hypermedia.affordance.Affordance.java

/**
 * The "hreflang" parameter, when present, is a hint indicating what the language of the result of dereferencing
 * the/*w  w w  .ja  v a2s.  co  m*/
 * link should be.  Note that this is only a hint; for example, it does not override the Content-Language header of
 * a HTTP response obtained by actually following the link.  Multiple "hreflang" parameters on a single link- value
 * indicate that multiple languages are available from the indicated resource.
 *
 * @param hreflang
 *         to add
 */
public void addHreflang(String hreflang) {
    Assert.hasLength(hreflang);
    linkParams.add("hreflang", hreflang);
}

From source file:com.github.hateoas.forms.affordance.Affordance.java

/**
 * The "hreflang" parameter, when present, is a hint indicating what the language of the result of dereferencing the link should be.
 * Note that this is only a hint; for example, it does not override the Content-Language header of a HTTP response obtained by actually
 * following the link. Multiple "hreflang" parameters on a single link- value indicate that multiple languages are available from the
 * indicated resource.//from   w  w  w.  jav  a 2  s .  c  om
 *
 * @param hreflang to add
 */
public void addHreflang(final String hreflang) {
    Assert.hasLength(hreflang);
    linkParams.add("hreflang", hreflang);
}

From source file:org.jcf.GraphicObjectHandlerImpl.java

public GraphicObjectHandler createTextObject(String text, Location loc) {
    Assert.hasLength(text);
    Assert.notNull(loc);/*from   w w w.  j a  va 2s  .c o m*/
    createAndReturnTextObject(text, loc);
    return this;
}

From source file:org.jcf.GraphicObjectHandlerImpl.java

public GraphicObjectHandler createTextObject(String text, Location loc,
        GraphicObjectProperty graphicObjectProperty) {
    Assert.hasLength(text);
    Assert.notNull(loc);/*w  w  w .  ja  v a2  s.  c  om*/
    GraphicObject g = createAndReturnTextObject(text, loc);
    g.setGraphicObjectProperty(graphicObjectProperty);
    return this;
}

From source file:de.escalon.hypermedia.affordance.Affordance.java

/**
 * The "rev" parameter has been used in the past to indicate that the semantics of the relationship are in the
 * reverse direction.  That is, a link from A to B with REL="X" expresses the same relationship as a link from B to
 * A with REV="X". "rev" is deprecated by this specification because it often confuses authors and readers; in most
 * cases, using a separate relation type is preferable.
 *
 * @param rev/*w w w. jav a2 s .c om*/
 *         to add
 */
public void addRev(String rev) {
    Assert.hasLength(rev);
    linkParams.add("rev", rev);
}

From source file:com.github.hateoas.forms.affordance.Affordance.java

/**
 * The "rev" parameter has been used in the past to indicate that the semantics of the relationship are in the reverse direction. That
 * is, a link from A to B with REL="X" expresses the same relationship as a link from B to A with REV="X". "rev" is deprecated by this
 * specification because it often confuses authors and readers; in most cases, using a separate relation type is preferable.
 *
 * @param rev to add/*from   w  w w.  ja  v  a  2s  .  co m*/
 */
public void addRev(final String rev) {
    Assert.hasLength(rev);
    linkParams.add("rev", rev);
}

From source file:de.escalon.hypermedia.affordance.Affordance.java

/**
 * Adds link-extension params, i.e. custom params which are not described in the web linking rfc.
 *
 * @param paramName//www. j  a v a 2  s.c  o  m
 *         of link-extension
 * @param values
 *         one or more values to add
 */
public void addLinkParam(String paramName, String... values) {
    Assert.notEmpty(values);
    for (String value : values) {
        Assert.hasLength(value);
        linkParams.add(paramName, value);
    }
}

From source file:org.jcf.MultiUserChatImpl.java

public JCFMessage createJCFMessage(String body) {
    Assert.hasLength(body);
    JCFMessage m = new MessageImpl();
    m.setBody(body);
    return m;
}

From source file:com.github.hateoas.forms.affordance.Affordance.java

/**
 * Adds link-extension params, i.e. custom params which are not described in the web linking rfc.
 *
 * @param paramName of link-extension/*from  www . j  av a 2  s  . c o m*/
 * @param values one or more values to add
 */
public void addLinkParam(final String paramName, final String... values) {
    Assert.notEmpty(values);
    for (String value : values) {
        Assert.hasLength(value);
        linkParams.add(paramName, value);
    }
}