aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/prelude/query/NonReducibleCompositeItem.java
blob: aee3257beb0e89e216d1a96f533b7317621d7d03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.query;

import java.util.Optional;

/**
 * A composite item which specifies semantics which are not maintained
 * if an instance with a single child is replaced by the single child.
 * Most composites, like AND and OR, are reducible as e.g (AND a) is semantically equal to (a).
 * This type functions as a marker type for query rewriters.
 *
 * @author bratseth
 */
public abstract class NonReducibleCompositeItem extends CompositeItem {

    @Override
    public Optional<Item> extractSingleChild() {
        return Optional.empty();
    }

}