PropertySet.java

biz/hammurapi/properties/PropertySet.java

Violations

Inspector Message Severity Location
Java Inspector 048 Copyrights information should be present in each file. 1
Java Inspector 089 Method documentation is too short. It is only 2 words. Should be at least 3 words. 2 88:9
Java Inspector 089 Undocumented parameter name 2 88:9
Java Inspector 089 Method return value is not documented 2 88:9
Java Inspector 089 Method is not properly documented 2 96:9
Java Inspector 089 Method documentation is too short. It is only 2 words. Should be at least 3 words. 2 103:9
Java Inspector 089 Parameter name is not documented 2 103:9
Java Inspector 089 Parameter value is not documented 2 103:9
Java Inspector 047 No need to provide (public, abstract, ) modifiers for interface methods 3 88:9
Java Inspector 047 No need to provide (public, abstract, ) modifiers for interface methods 3 96:9
Java Inspector 047 No need to provide (public, abstract, ) modifiers for interface methods 3 103: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.properties;
24
25import java.util.Set;
26
27import biz.hammurapi.config.MutableContext;
28
29/**
30 * Set of properties
31 * @author Pavel
32 *
33 * @param <V> Value type.
34 */
35public interface PropertySet extends MutableContext {
36
37 /**
38 * @return Names of properties in the set
39 */
40 Set getPropertyNames();
41
42 /**
43 * @param prefix
44 * @return Property set which operates on properties starting with given prefix.
45 */
46 PropertySet getSubset(String prefix);
47
48 /**
49 * Removes property from the set.
50 * @param name
51 */
52 boolean remove(String name);
53
54 /**
55 * Removes all entries from the property set
56 */
57 void clear();
58
59 /**
60 * Mounts source property set at specified prefix. E.g. if source property set has entry 'a' and prefix is 'b/' then that entry will be
61 * available as 'b/a'. Own property set entries shall shadow mounted entries.
62 * @param prefix
63 * @param source
64 */
65 void mount(String prefix, PropertySet source);
66
67 /**
68 * Copies all entries from the source property set to self.
69 * @param source
70 */
71 void setAll(PropertySet source);
72
73 /**
74 * @param subSet
75 * @return true if all properties of subset are present in this set with same values
76 */
77 boolean containsAll(PropertySet subSet);
78
79 /**
80 * @param otherSet
81 * @return true if all properties in this set are equal to properties in the other set.
82 */
83 boolean compareProperties(PropertySet otherSet);
84
85 /**
86 * Retrieves property.
87 */
88 public Object get(String name);
89
90 /**
91 * @param name Property name.
92 * @param defaultValue Default value.
93 * @return Property value or default value if property doesn't exist in the
94 * property set.
95 */
96 public Object get(String name, Object defaultValue);
97
98 /**
99 * Sets property.
100 * @param name
101 * @param value
102 */
103 public void set(String name, Object value);
104}
105