ResourceKey.java

biz/hammurapi/util/ResourceKey.java

Violations

Inspector Message Severity Location
Java Inspector 048 Copyrights information should be present in each file. 1
Java Inspector 089 Undocumented top level type 2 31:7
Java Inspector 089 Constructor is not properly documented 2 42:9
Java Inspector 089 Parameter className is not documented 2 42:9
Java Inspector 089 Parameter profile is not documented 2 42:9
Java Inspector 089 Parameter locale is not documented 2 42:9
Java Inspector 089 Parameter extension is not documented 2 42:9
Java Inspector 089 Undocumented method 2 51:9
Java Inspector 089 Undocumented method 2 67:9

Source code

1/*
2 * hgcommons 9
3 * Hammurapi Group Common Library
4 * Copyright (C) 2003 Hammurapi Group
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * URL: http://www.hammurapi.biz/hammurapi-biz/ef/xmenu/hammurapi-group/products/products/hgcommons/index.html
21 * e-Mail: support@hammurapi.biz
22 */
23package biz.hammurapi.util;
24
25import java.util.Locale;
26
27/**
28 * @author Pavel Vlasov
29 * @revision $Revision$
30 */
31class ResourceKey {
32 private String className;
33 private String profile;
34 private Locale locale;
35 private String extension;
36 /**
37 * @param className
38 * @param profile
39 * @param locale
40 * @param extension
41 */
42 public ResourceKey(String className, String profile, Locale locale,
43 String extension) {
44 super();
45 this.className = className;
46 this.profile = profile;
47 this.locale = locale;
48 this.extension = extension;
49 }
50
51 public boolean equals(Object otherKey) {
52 if (otherKey==this) {
53 return true;
54 }
55
56 if (otherKey instanceof ResourceKey) {
57 ResourceKey ork=(ResourceKey) otherKey;
58 return className.equals(ork.className)
59 && (profile==null ? ork.profile==null : profile.equals(ork.profile))
60 && (locale==null ? ork.locale==null : locale.equals(ork.locale))
61 && (extension==null ? ork.extension==null : extension.equals(ork.extension));
62 }
63
64 return false;
65 }
66
67 public int hashCode() {
68 return className.hashCode()
69 ^ (profile==null ? 0 : profile.hashCode())
70 ^ (locale==null ? 0 : locale.hashCode())
71 ^ (extension==null ? 0 : extension.hashCode());
72 }
73}
74