mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-19 23:02:24 +00:00
29 lines
588 B
Java
29 lines
588 B
Java
package com.avaje.ebeaninternal.server.expression;
|
|
|
|
import com.avaje.ebeaninternal.api.SpiNamedParam;
|
|
|
|
/**
|
|
* Helper for evaluating named parameters.
|
|
*/
|
|
class NamedParamHelp {
|
|
|
|
/**
|
|
* Return the bind value taking into account named parameters.
|
|
*/
|
|
static Object value(Object val) {
|
|
if (val instanceof SpiNamedParam) {
|
|
return ((SpiNamedParam) val).getValue();
|
|
}
|
|
return val;
|
|
}
|
|
|
|
/**
|
|
* Return the value as a string.
|
|
*/
|
|
static String valueAsString(Object val) {
|
|
Object value = value(val);
|
|
return (value == null) ? null : value.toString();
|
|
}
|
|
|
|
}
|