Object newValue = value;
if (attribute.getDataType().equals(Long.class.getName()))
{
if (MAX_LONG.compareTo(new BigInteger(value)) == -1)
{
throw new ManagementConsoleException("Entered value is too big for \"" +
ViewUtility.getDisplayText(attribute.getName()) + "\"");
}
newValue = Long.parseLong(value);
}
else if (attribute.getDataType().equals(Integer.class.getName()))
{
if (MAX_INT.compareTo(new BigInteger(value)) == -1)
{
throw new ManagementConsoleException("Entered value is too big for " + attribute.getName());
}
newValue = Integer.parseInt(value);
}
else if (attribute.getDataType().equals(Boolean.class.getName()))
{
if (!value.equalsIgnoreCase("true") && !value.equalsIgnoreCase("false"))
{
throw new ManagementConsoleException("Entered value was not true or false");
}
newValue = Boolean.valueOf(value);
}