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:com.ai.bss.util.user.DigestUtils.java

/**
 * Calculate the MD5 hash for a given string.
 *
 * @param text The string to calculate the hash for
 * @return The hex representation of the hash value
 *//*from   w w  w  . j  a v a2  s .co m*/
public static String md5(String text) {
    Assert.notNull(text);
    try {
        MessageDigest md = MessageDigest.getInstance("MD5");
        return hex(md.digest(text.getBytes()));
    } catch (NoSuchAlgorithmException ex) {
        throw new IllegalStateException(
                "Unable to calculate hash. No MD5 hasher available in this Java implementation", ex);
    }
}

From source file:se.vgregion.mobile.types.Facility.java

public Facility(String id, String name, Position position) {
    Assert.hasText(id);/*from  w ww  .  j  a  va  2  s  .  c om*/
    Assert.hasText(name);
    Assert.notNull(position);

    this.id = id;
    this.name = name;
    this.position = position;
}

From source file:org.mule.modules.automation.testcases.CreateIssueTestCases.java

@Category({ RegressionTests.class, SmokeTests.class })
@Test/*  ww  w.jav  a  2 s  .co m*/
public void testCreateIssue() throws Exception {
    Issue result = runFlowAndGetPayload("create-issue");
    Collection<Issue> projectIssues = runFlowAndGetPayload("get-project-issues");
    Assert.notNull(result);
    Assert.isTrue(projectIssues.contains(result));
    Assert.isTrue(result.getSubject().contentEquals("Connector Testing: Creating new Issue"));
    Assert.isTrue(result.getDescription().contentEquals("Connector Testing: Description for the new Issue"));
    Assert.isTrue(result.getPriorityId() == 4);
    Assert.isTrue(result.getStatusId() == 1);
    Assert.isTrue(result.getStatusName().contentEquals("New"));
}

From source file:com.joyveb.dbpimpl.cass.prepare.generator.WithNameCqlGenerator.java

protected void setSpecification(WithNameSpecification<T> specification) {
    Assert.notNull(specification);
    this.specification = specification;
}

From source file:org.vaadin.spring.mvp.Presenter.java

/**
 * The constructor automatically subscribes to event bus events.
 *
 * @param view <em>View</em>
 * @param eventBus Vaadin even bus//  ww w  . j a  va2  s  . c  om
 */
public Presenter(T view, EventBus eventBus) {
    Assert.notNull(view);
    Assert.notNull(eventBus);
    this.view = view;
    this.eventBus = eventBus;
    eventBus.subscribe(this);
}

From source file:io.kahu.hawaii.domain.FieldChecker.java

public boolean checkAllFieldsAreBlank(Object bean) throws ServerException {
    Assert.notNull(bean);
    return checkAllFieldsAreBlank(bean, getFieldNames(bean));
}

From source file:com.jaxio.celerio.model.support.ClassNamer.java

public ClassNamer(Entity entity, ClassType classType) {
    Assert.notNull(entity);
    Assert.notNull(classType);

    this.entity = entity;
    this.classType = classType;
}

From source file:com.nmote.xr.spring.XRSpringExporter.java

public void setFaultMapper(FaultMapper faultMapper) {
    Assert.notNull(faultMapper);
    this.faultMapper = faultMapper;
}

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

@SuppressWarnings("rawtypes")
@Override/*  w ww. j  av a 2s  . c om*/
public String constructOut(Object value, Environment env, Map params) throws TemplateException {
    Assert.notNull(value);
    DateFormat dateFormat = getDateFormat(params);
    return dateFormat.format(value);
}

From source file:net.eusashead.spring.gaecache.ArgumentHash.java

public ArgumentHash(String raw, HashAlgorithm strategy) {

    // Check parameters
    Assert.notNull(raw);
    Assert.notNull(strategy);/*from   w  ww .j  a  va  2  s .c  o  m*/

    // Create hash
    String hash = strategy.hash(raw);

    // Set variables
    this.raw = raw;
    this.hash = hash;
}