java.lang.Object
no.ntnu.principes.domain.ConfigValue
The
ConfigValue class represents a configuration entry with a unique ID,
a key identifying the configuration, a value stored as a String, and a timestamp
indicating when the configuration was created.
Includes utility methods to interpret the configuration value as specific data types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanConverts the stored string value to a boolean.intConverts the stored String value to an integer.
-
Constructor Details
-
ConfigValue
public ConfigValue()
-
-
Method Details
-
getBooleanValue
public boolean getBooleanValue()Converts the stored string value to a boolean.- Returns:
trueif the string value represents "true", otherwisefalse. Returnsfalseif the value is null or does not match "true".
-
getIntValue
public int getIntValue()Converts the stored String value to an integer.- Returns:
- the integer representation of the String value.
- Throws:
NumberFormatException- if the value cannot be parsed as an integer.
-