blob: 4d998f3553c27c3ba45dcd0fab652789aeb67948 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.textserialize.item;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import static com.yahoo.search.query.textserialize.item.ListUtil.firstInstanceOf;
/**
* @author Tony Vaagenes
*/
public class ItemArguments {
public final Map<?, ?> properties;
public final List<Object> children;
public ItemArguments(List<Object> arguments) {
if (firstInstanceOf(arguments, Map.class)) {
properties = (Map<?, ?>) ListUtil.first(arguments);
children = ListUtil.rest(arguments);
} else {
properties = Collections.emptyMap();
children = arguments;
}
}
}
|