blob: 50cc9c42773eb7c5760a2b0912dcdcfd7dcec5c9 (
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 2016 Yahoo Inc. 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 tonytv
*/
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;
}
}
}
|