Last change
on this file since 7246 was 7083, checked in by Don-vip, 10 years ago |
see #8465 - replace Utils.equal by Objects.equals , new in Java 7
|
-
Property svn:eol-style
set to
native
|
File size:
1010 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.mappaint;
|
---|
3 |
|
---|
4 | import java.util.Objects;
|
---|
5 |
|
---|
6 | public class Keyword {
|
---|
7 | public final String val;
|
---|
8 |
|
---|
9 | public Keyword(String val) {
|
---|
10 | this.val = val.toLowerCase();
|
---|
11 | }
|
---|
12 |
|
---|
13 | @Override
|
---|
14 | public String toString() {
|
---|
15 | return "Keyword{" + val + '}';
|
---|
16 | }
|
---|
17 |
|
---|
18 | @Override
|
---|
19 | public boolean equals(Object obj) {
|
---|
20 | if (obj == null || getClass() != obj.getClass())
|
---|
21 | return false;
|
---|
22 | return Objects.equals(val, ((Keyword) obj).val);
|
---|
23 | }
|
---|
24 |
|
---|
25 | @Override
|
---|
26 | public int hashCode() {
|
---|
27 | return val.hashCode();
|
---|
28 | }
|
---|
29 |
|
---|
30 | public static final Keyword AUTO = new Keyword("auto");
|
---|
31 | public static final Keyword BOTTOM = new Keyword("bottom");
|
---|
32 | public static final Keyword CENTER = new Keyword("center");
|
---|
33 | public static final Keyword DEFAULT = new Keyword("default");
|
---|
34 | public static final Keyword RIGHT = new Keyword("right");
|
---|
35 | public static final Keyword THINNEST = new Keyword("thinnest");
|
---|
36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.