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 (obj == null || getClass() != obj.getClass()) 022 return false; 023 return Objects.equals(val, ((Keyword) obj).val); 024 } 025 026 @Override 027 public int hashCode() { 028 return val.hashCode(); 029 } 030 031 public static final Keyword AUTO = new Keyword("auto"); 032 public static final Keyword BOTTOM = new Keyword("bottom"); 033 public static final Keyword CENTER = new Keyword("center"); 034 public static final Keyword DEFAULT = new Keyword("default"); 035 public static final Keyword RIGHT = new Keyword("right"); 036 public static final Keyword THINNEST = new Keyword("thinnest"); 037}