public class HashMethodExecutor
extends java.lang.Object
implements org.springframework.expression.MethodExecutor
MethodExecutor
using an first argument as an
Object to get its hashcode and second argument expected to
be an Integer to calculate a simple bucket name.
Spel expression "hash(region,2)" would create either key
"0_hash" or "1_hash". Using a bucketsize 0 results
an AccessException
.
Constructor and Description |
---|
HashMethodExecutor() |
Modifier and Type | Method and Description |
---|---|
org.springframework.expression.TypedValue |
execute(org.springframework.expression.EvaluationContext context,
java.lang.Object target,
java.lang.Object... arguments) |
static java.lang.String |
hash(int arg1,
int arg2) |
static java.lang.String |
hash(java.lang.Object arg1,
java.lang.Integer arg2) |
public org.springframework.expression.TypedValue execute(org.springframework.expression.EvaluationContext context, java.lang.Object target, java.lang.Object... arguments) throws org.springframework.expression.AccessException
execute
in interface org.springframework.expression.MethodExecutor
org.springframework.expression.AccessException
public static java.lang.String hash(int arg1, int arg2)
public static java.lang.String hash(java.lang.Object arg1, java.lang.Integer arg2)