aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src/main/java/com/yahoo/tensor/evaluation/Name.java
blob: 57c0dbe16565faa0ada53387ce150584eb36f734 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.tensor.evaluation;

/** A name which is just a string. Names are value objects. */
public class Name {

    private final String name;

    public Name(String name) {
        this.name = name;
    }

    public String name() { return name; }

    @Override
    public String toString() { return name; }

    @Override
    public int hashCode() { return name.hashCode(); }

    @Override
    public boolean equals(Object other) {
        if (other == this) return true;
        if ( ! (other instanceof Name)) return false;
        return ((Name)other).name.equals(this.name);
    }

}