Example usage for org.springframework.integration.redis.support RedisHeaders ZSET_SCORE

List of usage examples for org.springframework.integration.redis.support RedisHeaders ZSET_SCORE

Introduction

In this page you can find the example usage for org.springframework.integration.redis.support RedisHeaders ZSET_SCORE.

Prototype

String ZSET_SCORE

To view the source code for org.springframework.integration.redis.support RedisHeaders ZSET_SCORE.

Click Source Link

Usage

From source file:org.springframework.integration.redis.outbound.RedisCollectionPopulatingMessageHandler.java

private double determineScore(Message<?> message) {
    Object scoreHeader = message.getHeaders().get(RedisHeaders.ZSET_SCORE);
    if (scoreHeader == null) {
        return Double.valueOf(1);
    } else {//from w w  w  . j  a va  2 s .  c  om
        Assert.isInstanceOf(Number.class, scoreHeader,
                "Header " + RedisHeaders.ZSET_SCORE + " must be a Number");
        Number score = (Number) scoreHeader;
        return Double.valueOf(score.toString());
    }
}