summaryrefslogtreecommitdiffstats
path: root/linguistics/src/main/java/com/yahoo/language/detect/Hint.java
blob: 50291c922e8472eee96bb7b20816b2741e691603 (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
31
32
33
34
35
36
37
38
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.language.detect;

/**
 * <p>A hint that can be given to a {@link Detector}.</p>
 *
 * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
 */
public class Hint {

    private final String market;
    private final String country;

    private Hint(String market, String country) {
        this.market = market;
        this.country = country;
    }

    public String getMarket() {
        return market;
    }

    public String getCountry() {
        return country;
    }

    public static Hint newMarketHint(String market) {
        return new Hint(market, null);
    }

    public static Hint newCountryHint(String country) {
        return new Hint(null, country);
    }

    public static Hint newInstance(String market, String country) {
        return new Hint(market, country);
    }
}