Example usage for org.springframework.util Assert hasText

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

Introduction

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

Prototype

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

Source Link

Document

Assert that the given String contains valid text content; that is, it must not be null and must contain at least one non-whitespace character.

Usage

From source file:org.innobuilt.wicket.rest.example.dao.HibernatePersonDAO.java

public Person findPerson(String username) {
    Assert.hasText(username);
    String query = "from Person p where p.username = :username";
    return (Person) getSession().createQuery(query).setString("username", username).uniqueResult();
}

From source file:com.frank.search.solr.core.query.FieldWithQueryParameters.java

/**
 * @param fieldname must not be null
 */
public FieldWithQueryParameters(String fieldname) {
    super(fieldname);
    Assert.hasText(fieldname);
}

From source file:com.streamreduce.core.dao.RoleDAO.java

public Role findRole(String name) {
    Assert.hasText(name);
    return ds.find(entityClazz, "name", name).get();
}

From source file:com.streamreduce.core.dao.AccountDAO.java

public Account findByName(String name) {
    Assert.hasText(name);
    return ds.find(entityClazz, "name", name).get();
}

From source file:com.azaptree.services.command.CommandKey.java

public CommandKey(final String catalogName, final String commandName) {
    Assert.hasText(catalogName);
    Assert.hasText(commandName);/*from w w w  .j av a2s .c om*/
    this.catalogName = catalogName;
    this.commandName = commandName;
    this.hashCode = Objects.hash(catalogName, commandName);
}

From source file:org.xinta.eazycode.components.shiro.dao.HibernateUserDAO.java

public User findUser(String username) {
    Assert.hasText(username);
    return this.findByUnique("username", username);
}

From source file:JavaMvc.DAO.Impl.UserDaoImp.java

public User findUser(String username) {
    Assert.hasText(username);
    String query = "from User u where u.username = '" + username + "'";
    return (User) getSession().createQuery(query).uniqueResult();
}

From source file:com.oreilly.springdata.neo4j.core.Customer.java

public Customer(String firstName, String lastName, String emailAddress) {

    Assert.hasText(firstName);
    Assert.hasText(lastName);//from w ww.  j ava 2  s . c o m
    Assert.hasText(emailAddress);

    this.firstName = firstName;
    this.lastName = lastName;
    this.emailAddress = emailAddress;
}

From source file:com.epam.cme.storefront.forms.validation.EqualAttributesValidator.java

@Override
public void initialize(final EqualAttributes constraintAnnotation) {
    Assert.notEmpty(constraintAnnotation.value());
    Assert.isTrue(constraintAnnotation.value().length == 2);
    firstAttribute = constraintAnnotation.value()[0];
    secondAttribute = constraintAnnotation.value()[1];
    Assert.hasText(firstAttribute);
    Assert.hasText(secondAttribute);/*from w  ww .j a  v  a  2s .c  o  m*/
    Assert.isTrue(!firstAttribute.equals(secondAttribute));
}

From source file:com.ellin.gemfire.demo.model.Customer.java

/**
 * Creates a new {@link com.ellin.gemfire.demo.model.Customer} from the given parameters.
 * @param id the unique id;/* w w w  .  ja  v  a  2  s  .  c  o  m*/
 * @param firstname must not be {@literal null} or empty.
 * @param lastname must not be {@literal null} or empty.
 */
public Customer(Long id, String firstname, String lastname) {
    Assert.hasText(firstname);
    Assert.hasText(lastname);

    this.firstname = firstname;
    this.lastname = lastname;
    this.id = id;
}