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

@Deprecated
public static void notNull(@Nullable Object object) 

Source Link

Document

Assert that an object is not null .

Usage

From source file:org.cloudfoundry.identity.uaa.audit.event.AuditListener.java

public AuditListener(UaaAuditService auditor) {
    Assert.notNull(auditor);
    this.uaaAuditService = auditor;
}

From source file:org.arrow.runtime.mapper.AppendMessageMapper.java

public AppendMessageMapper(EventMessage... messages) {
    this.messages = messages;
    Assert.notNull(messages);
}

From source file:com.ewcms.publication.freemarker.directive.out.article.RelationsDirectiveOut.java

@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public Object loopValue(Object value, Environment env, Map params) throws TemplateException {
    Assert.notNull(value);
    List<ArticleInfo> articles = getRelation((List<Long>) value);
    return articles;
}

From source file:security.LoginService.java

public static UserAccount getPrincipal() {
    UserAccount result;//w ww.j  ava 2  s.  c om
    SecurityContext context;
    Authentication authentication;
    Object principal;

    // If the asserts in this method fail, then you're
    // likely to have your Tomcat's working directory
    // corrupt. Please, clear your browser's cache, stop
    // Tomcat, update your Maven's project configuration,
    // clean your project, clean Tomcat's working directory,
    // republish your project, and start it over.

    context = SecurityContextHolder.getContext();
    Assert.notNull(context);
    authentication = context.getAuthentication();
    Assert.notNull(authentication);
    principal = authentication.getPrincipal();
    Assert.isTrue(principal instanceof UserAccount);
    result = (UserAccount) principal;
    Assert.notNull(result);
    Assert.isTrue(result.getId() != 0);

    return result;
}

From source file:org.openmrs.module.sync.SyncUtilTest.java

@Test
public void getSetterMethod_shouldReturnMethodForPrimitiveLong() {
    Method m = SyncUtil.getSetterMethod(new Xform().getClass(), "longField", new Long(1).getClass());
    Assert.notNull(m);
}

From source file:org.arrow.service.engine.concurrent.dispatch.onsuccess.NotifyOnSuccess.java

public NotifyOnSuccess(ProcessInstance processInstance) {
    Assert.notNull(processInstance);
    this.processInstance = processInstance;
}

From source file:net.groupbuy.dao.impl.ParameterGroupDaoImpl.java

/**
 * ???/*from  www. j a  v a  2s .  co  m*/
 * 
 * @param parameterGroup
 *            ?
 * @return ?
 */
@Override
public ParameterGroup merge(ParameterGroup parameterGroup) {
    Assert.notNull(parameterGroup);

    Set<Parameter> excludes = new HashSet<Parameter>();
    CollectionUtils.select(parameterGroup.getParameters(), new Predicate() {
        public boolean evaluate(Object object) {
            Parameter parameter = (Parameter) object;
            return parameter != null && parameter.getId() != null;
        }
    }, excludes);
    List<Parameter> parameters = parameterDao.findList(parameterGroup, excludes);
    for (int i = 0; i < parameters.size(); i++) {
        Parameter parameter = parameters.get(i);
        String jpql = "select product from Product product join product.parameterValue parameterValue where index(parameterValue) = :parameter";
        List<Product> products = entityManager.createQuery(jpql, Product.class)
                .setFlushMode(FlushModeType.COMMIT).setParameter("parameter", parameter).getResultList();
        for (Product product : products) {
            product.getParameterValue().remove(parameter);
            if (i % 20 == 0) {
                super.flush();
                super.clear();
            }
        }
    }
    return super.merge(parameterGroup);
}

From source file:net.groupbuy.dao.impl.DeliveryTemplateDaoImpl.java

/**
 * ??/*from   w  ww. jav a  2s  .c o m*/
 * 
 * @param deliveryTemplate
 *            ??
 */
@Override
public void persist(DeliveryTemplate deliveryTemplate) {
    Assert.notNull(deliveryTemplate);
    if (deliveryTemplate.getIsDefault()) {
        String jpql = "update DeliveryTemplate deliveryTemplate set deliveryTemplate.isDefault = false where deliveryTemplate.isDefault = true";
        entityManager.createQuery(jpql).setFlushMode(FlushModeType.COMMIT).executeUpdate();
    }
    super.persist(deliveryTemplate);
}

From source file:com.ewcms.publication.freemarker.directive.out.LengthDirectiveOut.java

@SuppressWarnings("rawtypes")
@Override/*from  w ww . j  ava 2  s.c om*/
public Object loopValue(Object value, Environment env, Map params) throws TemplateException {
    Assert.notNull(value);
    return constructOut(value, env, params);
}

From source file:de.olivergierke.whoops.customer.CustomerServiceImpl.java

/**
 * Creates a new {@link CustomerServiceImpl}.
 * // w ww  .j a v a 2 s .c om
 * @param repository must not be {@literal null}.
 */
@Autowired
public CustomerServiceImpl(CustomerRepository repository) {

    Assert.notNull(repository);
    this.repository = repository;
}