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.zalando.github.spring.pagination.RelationsPredicate.java

public RelationsPredicate(String relation) {
    Assert.notNull(relation, "'relation' should never be null");
    Assert.hasText(relation, "'relation' should never be empty");
    this.relation = relation;
}

From source file:com.nec.crud.hibernate.HibernateSessionManager.java

/**
 * Gets the active session for this request, creating it as necessary. When
 * the session is first created, a transaction is started.
 * /* ww  w . j  a va  2s .  co  m*/
 * @return the request's session
 */
public static Session getSession() {
    // ??????
    Session session = getSessionFactory().openSession();

    // No Hibernate Session bound to thread
    Assert.notNull(session, "No Hibernate Session bound to thread");

    // We're having some difficult to diagnose connection issues at the moment.
    // To experiment lets test the connection when opened, if it fails do a rollback
    if (!isConnected(session) || session.isDirty()) {
        // ?
        closeSession(session);

        // ??????
        session = getSession();
    }
    return session;
}

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

public SimpleCalculatedField(String alias, Function function) {
    Assert.notNull(function, "Function cannot be empty.");

    this.alias = alias;
    this.function = function;
}

From source file:org.opencredo.cloud.storage.s3.AwsCredentials.java

/**
 * @param ak//from   w  w w  . j  a v  a 2 s  .c  om
 *            AWS Access Key
 * @param sak
 *            AWS Secret Access Key
 */
public AwsCredentials(String ak, String sak) {
    Assert.notNull(ak, "Access key is not provided");
    Assert.notNull(sak, "Secret access key is not provided");

    accessKey = ak;
    secretAccessKey = sak;
}

From source file:io.galeb.core.entity.RuleOrder.java

public RuleOrder(Long ruleId, Integer ruleOrder) {
    Assert.notNull(ruleId, "[Assertion failed] - this argument is required; it must not be null");
    Assert.notNull(ruleOrder, "[Assertion failed] - this argument is required; it must not be null");
    this.ruleId = ruleId;
    this.ruleOrder = ruleOrder;
}

From source file:io.isoft.reg.repository.criteria.StaffDictSearchCriteria.java

public StaffDictSearchCriteria(String inputCode) {
    Assert.notNull(inputCode, "inputCode must not be null");
    this.inputCode = inputCode;
}

From source file:us.swcraft.springframework.session.messages.AttributeSerializationRequest.java

public AttributeSerializationRequest(final String key, final Object value) {
    super(key, value);
    Assert.notNull(key, "Key can't be null");
    Assert.notNull(key, "Value can't be null");
}

From source file:siia.business.FlightEventTransformer.java

@Autowired
public FlightEventTransformer(FlightScheduler flightScheduler) {
    Assert.notNull(flightScheduler, "flightScheduler must not be null");
    this.flightScheduler = flightScheduler;
}

From source file:us.swcraft.springframework.session.messages.AttributeSerializationResponse.java

public AttributeSerializationResponse(final String key, final byte[] value) {
    super(key, value);
    Assert.notNull(key, "Key can't be null");
    Assert.notNull(key, "Value can't be null");
}

From source file:io.dyn.net.nio.BufferByteChannel.java

public BufferByteChannel(Buffer buffer) {
    Assert.notNull(buffer, "Buffer cannot be null.");
    this.buffer = buffer;
}