Class XContentMapValues
- java.lang.Object
-
- org.elasticsearch.common.xcontent.support.XContentMapValues
-
public class XContentMapValues extends Object
-
-
Constructor Summary
Constructors Constructor Description XContentMapValues()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Object>extractRawValues(String path, Map<String,Object> map)Extracts raw values (string, int, and so on) based on the path provided returning all of them as a single list.static ObjectextractValue(String path, Map<?,?> map)static ObjectextractValue(Map<?,?> map, String... pathElements)static Function<Map<String,?>,Map<String,Object>>filter(String[] includes, String[] excludes)Returns a function that filters a document map based on the given include and exclude rules.static Map<String,Object>filter(Map<String,?> map, String[] includes, String[] excludes)Only keep properties inmapthat match theincludesbut not theexcludes.static booleanisArray(Object node)static booleanisObject(Object node)static booleannodeBooleanValue(Object node)static booleannodeBooleanValue(Object node, boolean defaultValue)static booleannodeBooleanValue(Object node, String name)static booleannodeBooleanValue(Object node, String name, boolean defaultValue)static bytenodeByteValue(Object node)static bytenodeByteValue(Object node, byte defaultValue)static doublenodeDoubleValue(Object node)static doublenodeDoubleValue(Object node, double defaultValue)static floatnodeFloatValue(Object node)static floatnodeFloatValue(Object node, float defaultValue)static intnodeIntegerValue(Object node)static intnodeIntegerValue(Object node, int defaultValue)static longnodeLongValue(Object node)static longnodeLongValue(Object node, long defaultValue)static Map<String,Object>nodeMapValue(Object node, String desc)static shortnodeShortValue(Object node)static shortnodeShortValue(Object node, short defaultValue)static String[]nodeStringArrayValue(Object node)Returns an array of string value from a node value.static StringnodeStringValue(Object node, String defaultValue)static TimeValuenodeTimeValue(Object node)static TimeValuenodeTimeValue(Object node, TimeValue defaultValue)
-
-
-
Method Detail
-
extractRawValues
public static List<Object> extractRawValues(String path, Map<String,Object> map)
Extracts raw values (string, int, and so on) based on the path provided returning all of them as a single list.
-
filter
public static Map<String,Object> filter(Map<String,?> map, String[] includes, String[] excludes)
Only keep properties inmapthat match theincludesbut not theexcludes. An empty list of includes is interpreted as a wildcard while an empty list of excludes does not match anything. If a property matches both an include and an exclude, then the exclude wins. If an object matches, then any of its sub properties are automatically considered as matching as well, both for includes and excludes. Dots in field names are treated as sub objects. So for instance if a document containsa.bas a property andais an include, thena.bwill be kept in the filtered map.
-
filter
public static Function<Map<String,?>,Map<String,Object>> filter(String[] includes, String[] excludes)
Returns a function that filters a document map based on the given include and exclude rules.- See Also:
for details
-
isObject
public static boolean isObject(Object node)
-
isArray
public static boolean isArray(Object node)
-
nodeFloatValue
public static float nodeFloatValue(Object node, float defaultValue)
-
nodeFloatValue
public static float nodeFloatValue(Object node)
-
nodeDoubleValue
public static double nodeDoubleValue(Object node, double defaultValue)
-
nodeDoubleValue
public static double nodeDoubleValue(Object node)
-
nodeIntegerValue
public static int nodeIntegerValue(Object node)
-
nodeIntegerValue
public static int nodeIntegerValue(Object node, int defaultValue)
-
nodeShortValue
public static short nodeShortValue(Object node, short defaultValue)
-
nodeShortValue
public static short nodeShortValue(Object node)
-
nodeByteValue
public static byte nodeByteValue(Object node, byte defaultValue)
-
nodeByteValue
public static byte nodeByteValue(Object node)
-
nodeLongValue
public static long nodeLongValue(Object node, long defaultValue)
-
nodeLongValue
public static long nodeLongValue(Object node)
-
nodeBooleanValue
public static boolean nodeBooleanValue(Object node, String name, boolean defaultValue)
-
nodeBooleanValue
public static boolean nodeBooleanValue(Object node, boolean defaultValue)
-
nodeBooleanValue
public static boolean nodeBooleanValue(Object node)
-
-