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.trenako.mapping.WeakDbRef.java

/**
 * Builds a new {@code WeakDbRef} for the provided entity.
 *
 * @param entity the entity object//from   w w w  .  j  av a2  s .  co  m
 * @return the new {@code WeakDbRef}
 */
public static <E extends DbReferenceable> WeakDbRef<E> buildRef(E entity) {
    Assert.notNull(entity, "Weak ref: entity obj is required.");
    return new WeakDbRef<E>(entity);
}

From source file:org.vertx.spring.examples.ContainerAutowiredBean.java

@Override
public void afterPropertiesSet() throws Exception {
    Assert.notNull(container, "Container must not be null!");
}

From source file:org.springmodules.validation.util.condition.range.AbstractRangeCondition.java

/**
 * Constructs a new AbstractRangeCondition.
 *//*from   w  w w.j a v  a2  s.com*/
public AbstractRangeCondition(Comparator comparator) {
    Assert.notNull(comparator, "Comparator cannot be null");
    this.comparator = comparator;
}

From source file:org.cloudfoundry.identity.uaa.authentication.event.UserAuthenticationFailureEvent.java

public UserAuthenticationFailureEvent(UaaUser user, Authentication authentication) {
    super(authentication);
    Assert.notNull(user, "UaaUser object cannot be null");
    this.user = user;
}

From source file:org.manu.service.CityServiceImpl.java

@Override
public City getCity(String name) {
    Assert.notNull(name, "Nme must not be null");
    return this.cityRepository.findByName(name);
}

From source file:io.spring.batch.JdbcSimilaritiesItemWriter.java

public JdbcSimilaritiesItemWriter(DataSource dataSource) {
    Assert.notNull(dataSource, "A datasource is required");

    this.jdbcTemplate = new JdbcTemplate(dataSource);
}

From source file:org.axonframework.sample.app.api.RegisterAddressCommand.java

public void setAddressType(AddressType addressType) {
    Assert.notNull(addressType, "An Address type must be provided.");
    this.addressType = addressType;
}

From source file:org.springmodules.validation.valang.javascript.AbstractValangJavaScriptTranslator.java

/**
 * Returns a <code>Reader</code> for accessing the JavaScript codebase used by the translated validation rules.
 *//*w w  w .  j a v  a 2s  . c om*/
public static Reader getCodebaseReader() {
    Class clazz = AbstractValangJavaScriptTranslator.class;
    InputStream resourceAsStream = clazz.getResourceAsStream(VALANG_CODEBASE_JS);

    Assert.notNull(resourceAsStream, "Valang Codebase not found!");
    return new InputStreamReader(resourceAsStream);
}

From source file:org.springmodules.validation.util.condition.common.InstanceOfCondition.java

/**
 * Constructs a new InstanceOfCondition with a given class the checked object will be checked against.
 *
 * @param clazz The class the checked object will be checked against.
 *//* www. j a v a 2 s. co m*/
public InstanceOfCondition(Class clazz) {
    Assert.notNull(clazz, "Class cannot be null");
    this.clazz = clazz;
}

From source file:org.springmodules.validation.util.condition.common.NotCondition.java

/**
 * Constructs a new NotCondition with the condition to reverse.
 *
 * @param condition The condition to reverse.
 *///w w  w.  j  a  va  2 s.  com
public NotCondition(Condition condition) {
    Assert.notNull(condition, "Condition cannot be null");
    this.condition = condition;
}