Example usage for org.springframework.util Assert notNull

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

Introduction

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

Prototype

public static void notNull(@Nullable Object object, Supplier<String> messageSupplier) 

Source Link

Document

Assert that an object is not null .

Usage

From source file:org.geowebcache.diskquota.storage.PageStatsPayload.java

public PageStatsPayload(final TilePage page) {
    Assert.notNull(page, "Page can't be null");
    this.page = page;
}

From source file:com.frank.search.solr.core.TermsQueryParser.java

@Override
public SolrQuery doConstructSolrQuery(TermsQuery query) {
    Assert.notNull(query, "Cannot construct solrQuery from null value.");

    SolrQuery solrQuery = new SolrQuery();
    String queryString = getQueryString(query);
    if (StringUtils.hasText(queryString)) {
        solrQuery.setParam(CommonParams.Q, queryString);
    }/*  www . j a v  a  2  s.co  m*/
    appendTermsOptionsToSolrQuery(query.getTermsOptions(), solrQuery);
    processTermsFields(solrQuery, query);
    appendRequestHandler(solrQuery, query.getRequestHandler());
    return solrQuery;
}

From source file:org.italiangrid.storm.webdav.authz.vomap.DefaultVOMembershipProvider.java

public DefaultVOMembershipProvider(String voName, VOMembershipSource membershipSource) {

    Assert.hasText(voName, "voName cannot be null or empty!");
    Assert.notNull(membershipSource, "membershipSource cannot be null!");

    this.voName = voName;
    this.membershipSource = membershipSource;
    members = this.membershipSource.getVOMembers();
}

From source file:example.complete.DefaultCustomerManagement.java

/**
 * Creates a new {@link DefaultCustomerManagement} with the given {@link CustomerRepository}.
 * //www.  j a  v a 2  s.  com
 * @param customers must not be {@literal null}.
 */
@Autowired
public DefaultCustomerManagement(CustomerRepository customers) {

    Assert.notNull(customers, "CustomerRepository must not be null!");

    this.customers = customers;
}

From source file:fr.xebia.jms.BytesMessageOutputStream.java

public BytesMessageOutputStream(BytesMessage message) {
    Assert.notNull(message, "'message' must not be null");
    this.message = message;
}

From source file:org.ualerts.fixed.service.commands.DeleteFixtureCommand.java

/**
 * {@inheritDoc}// w  ww  .  j av  a 2s .c  o  m
 */
@Override
protected void onValidate() throws Exception {
    super.onValidate();
    Assert.notNull(getId(), "id is required");
}

From source file:com.acme.legacy.app.manager.SimpleUserManager.java

@Override
public User findByEmail(String email) {
    Assert.notNull(email, "email address required");
    return userRepository.findByEmail(email);
}

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

String getUnit() {
    synchronized (this.monitor) {
        Assert.notNull(this.unit, "Costs must specify a unit");
        return this.unit;
    }//from  w w  w .  j  a  v a  2s.c  o  m
}

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

/**
 * Add an criteria to the query. The criteria will be connected using 'AND'.
 * // w ww  .  j a v a  2 s . c  o  m
 * @param criteria
 * @return
 */
@SuppressWarnings("unchecked")
public final <T extends SolrDataQuery> T addCriteria(Criteria criteria) {
    Assert.notNull(criteria, "Cannot add null criteria.");

    if (this.criteria == null) {
        this.criteria = criteria;
    } else {
        if (this.criteria instanceof Crotch) {
            ((Crotch) this.criteria).add(criteria);
        } else {
            Crotch tree = new Crotch();
            tree.add(this.criteria);
            tree.add(criteria);
            this.criteria = tree;
        }
    }
    return (T) this;
}