Skip to content

Commit 0a0e1f4

Browse files
committed
JavaDoc.
1 parent 53fcf2e commit 0a0e1f4

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

core/src/main/java/org/bouncycastle/util/Properties.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
import java.util.StringTokenizer;
1414

1515
/**
16-
* Utility method for accessing system properties.
16+
* Utility method for accessing properties values - properties can be set in java.security,
17+
* thread local, and system properties. They are checked for in the same order with
18+
* checking stopped as soon as a value is found.
1719
*/
1820
public class Properties
1921
{
@@ -115,6 +117,13 @@ public static boolean removeThreadOverride(String propertyName)
115117
return false;
116118
}
117119

120+
/**
121+
* Return propertyName as an integer, defaultValue used if not defined.
122+
*
123+
* @param propertyName name of property.
124+
* @param defaultValue integer to return if property not defined.
125+
* @return value of property, or default if not found, as an int.
126+
*/
118127
public static int asInteger(String propertyName, int defaultValue)
119128
{
120129
String p = getPropertyValue(propertyName);
@@ -127,6 +136,12 @@ public static int asInteger(String propertyName, int defaultValue)
127136
return defaultValue;
128137
}
129138

139+
/**
140+
* Return propertyName as a BigInteger.
141+
*
142+
* @param propertyName name of property.
143+
* @return value of property as a BigInteger, null if not defined.
144+
*/
130145
public static BigInteger asBigInteger(String propertyName)
131146
{
132147
String p = getPropertyValue(propertyName);
@@ -157,6 +172,13 @@ public static Set<String> asKeySet(String propertyName)
157172
return Collections.unmodifiableSet(set);
158173
}
159174

175+
/**
176+
* Return the String value of the property propertyName. Property valuation
177+
* starts with java.security, then thread local, then system properties.
178+
*
179+
* @param propertyName name of property.
180+
* @return value of property as a String, null if not defined.
181+
*/
160182
public static String getPropertyValue(final String propertyName)
161183
{
162184
String val = (String)AccessController.doPrivileged(new PrivilegedAction()

0 commit comments

Comments
 (0)