aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/pagetemplates/model/AbstractChoice.java
blob: e9d65ea8724e2af4bb41531be6bc54f7dfec65c0 (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
27
28
29
30
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.pagetemplates.model;

import com.yahoo.component.provider.FreezableClass;

/**
 * Abstract superclass of various kinds of choices.
 *
 * @author bratseth
 */
public abstract class AbstractChoice extends FreezableClass implements PageElement {

    private String method;

    /**
     * Returns the choice method to use - a string interpreted by the resolver in use,
     * or null to use any available method
     */
    public String getMethod() { return method; }

    public void setMethod(String method) {
        ensureNotFrozen();
        this.method=method;
    }

    /** Returns true if this choice is (partially or completely) a choice between the given type */
    @SuppressWarnings("rawtypes")
    public abstract boolean isChoiceBetween(Class pageTemplateModelClass);

}