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:com.ctv.ViewResolverCustom.java

public ViewResolverCustom(ApplicationContext applicationContext) {
    Assert.notNull(applicationContext, "Application context is MANDATORY");
    this.applicationContext = applicationContext;
}

From source file:sample.data.rest.service.CitySearchCriteriaTemp.java

public CitySearchCriteriaTemp(String name) {
    Assert.notNull(name, "Name must not be null");
    this.name = name;
}

From source file:sipackage.config.xml.SIAdapterUpperPrefixParserUtils.java

/**
 * Create a new {@link BeanDefinitionBuilder} for the class {@link SIAdapterUpperPrefixExecutor}.
 * Initialize the wrapped {@link SIAdapterUpperPrefixExecutor} with common properties.
 *
 * @param element Must not be null/*from   w  w w .ja v  a 2  s  . c  om*/
 * @param parserContext Must not be null
 * @return The BeanDefinitionBuilder for the SIAdapterUpperPrefixExecutor
 */
public static BeanDefinitionBuilder getSIAdapterUpperPrefixExecutorBuilder(final Element element,
        final ParserContext parserContext) {

    Assert.notNull(element, "The provided element must not be null.");
    Assert.notNull(parserContext, "The provided parserContext must not be null.");

    final BeanDefinitionBuilder siAdapterLowerPrefixExecutorBuilder = BeanDefinitionBuilder
            .genericBeanDefinition(SIAdapterUpperPrefixExecutor.class);

    return siAdapterLowerPrefixExecutorBuilder;

}

From source file:org.esnm.server.data.jpa.service.EmployeeSearchCriteria.java

public EmployeeSearchCriteria(String employeeNumber) {
    Assert.notNull(employeeNumber, "EmployeeNumber must not be null");
    this.employeeNumber = employeeNumber;
}

From source file:org.jasig.cas.ticket.registry.AbstractTicketRegistry.java

/**
 * @throws IllegalArgumentException if class is null.
 * @throws ClassCastException if class does not match requested ticket
 * class.//w  ww .jav  a2s. co m
 */
public final Ticket getTicket(final String ticketId, final Class<? extends Ticket> clazz) {
    Assert.notNull(clazz, "clazz cannot be null");

    final Ticket ticket = this.getTicket(ticketId);

    if (ticket == null) {
        return null;
    }

    if (!clazz.isAssignableFrom(ticket.getClass())) {
        throw new ClassCastException("Ticket [" + ticket.getId() + " is of type " + ticket.getClass()
                + " when we were expecting " + clazz);
    }

    return ticket;
}

From source file:com.etrip.service.Impl.SupplierServiceImpl.java

@Override
public ResultMap search(String name, Integer page, Integer rows) {
    Assert.notNull(page, "page is null");
    Assert.notNull(rows, "rows is null");
    ResultMap resultMap = new ResultMap();
    FilterMap filterMap = FilterMap.init();
    filterMap.eq("deleted", 0);
    if (StringUtils.isNotBlank(name)) {
        filterMap.like("supplierName", "%" + name + "%");
    }//from  w w  w . j  a va 2s. c om
    Page queryPage = bSuppilierRepository.queryPage(filterMap, null, page, rows);
    int count = Integer.parseInt(queryPage.getPageInfo().get("pageCount").toString());
    int totalCount = Integer.parseInt(queryPage.getPageInfo().get("totalCount").toString());
    if (totalCount % count != 0) {
        queryPage.getPageInfo().put("totalPage", totalCount / count + 1);
    }
    resultMap.success();
    resultMap.put(queryPage);
    return resultMap;
}

From source file:com.mitchellbosecke.pebble.spring.context.Beans.java

public Beans(ApplicationContext ctx) {
    Assert.notNull(ctx, "Application Context cannot be null");
    this.ctx = ctx;
}

From source file:uiak.exper.gisamt.service.BusinessFunctionSearchCriteria.java

public BusinessFunctionSearchCriteria(String name) {
    Assert.notNull(name, "Name must not be null");
    this.name = name;
}

From source file:com.virtualobject.immo.data.jpa.service.AnnonceSearchCriteria.java

public AnnonceSearchCriteria(String name) {
    Assert.notNull(name, "Name must not be null");
    this.name = name;
}

From source file:org.opencredo.twitter.si.TwitterStreamConfiguration.java

public TwitterStreamConfiguration(TwitterCredentials credentials) {
    Assert.notNull(credentials, "credentials must not be null");
    this.credentials = credentials;
}