001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.gui.mappaint;
003
004import java.util.Locale;
005import java.util.Objects;
006
007public class Keyword {
008    public final String val;
009
010    public Keyword(String val) {
011        this.val = val.toLowerCase(Locale.ENGLISH);
012    }
013
014    @Override
015    public String toString() {
016        return "Keyword{" + val + '}';
017    }
018
019    @Override
020    public boolean equals(Object obj) {
021        if (this == obj) return true;
022        if (obj == null || getClass() != obj.getClass()) return false;
023        Keyword keyword = (Keyword) obj;
024        return Objects.equals(val, keyword.val);
025    }
026
027    @Override
028    public int hashCode() {
029        return Objects.hash(val);
030    }
031
032    public static final Keyword AUTO = new Keyword("auto");
033    public static final Keyword BOTTOM = new Keyword("bottom");
034    public static final Keyword CENTER = new Keyword("center");
035    public static final Keyword DEFAULT = new Keyword("default");
036    public static final Keyword RIGHT = new Keyword("right");
037    public static final Keyword THINNEST = new Keyword("thinnest");
038}