OpenAPI 1.0

com.aquafold.openapi.type
Interface AQShortFactory


public interface AQShortFactory

This interface provides manipulation and validation functionality for Short data type.

An instance of this interface is available via aqua.type.getShort(). (For technical reasons, aqua.type.short is not available).


Method Summary
 boolean isEqual(Object a, Object b)
          Checks if two values are equal, if treated as short integers.
 boolean isGreater(Object a, Object b)
          Checks if the value is greater than a specified threshold.
 boolean isGreaterOrEqual(Object a, Object b)
          Checks if the value is less than or equals to a specified threshold.
 boolean isInRange(Object value, Object min, Object max)
          Checks if the value is within a specified range, inclusive.
 boolean isLess(Object a, Object b)
          Checks if the value is less than a specified threshold.
 boolean isLessOrEqual(Object a, Object b)
          Checks if the value is less than or equals to a specified threshold.
 boolean isValid(String value)
          Interprets a specified value as a Short (using default platform locale).
 Short parse(Object value)
          Creates a Short instance assuming default platform locale.
 Short parse(String value, String pattern)
          Creates a Short instance using a specified pattern and locale.
 Short parse(String value, String pattern, String locale)
          Interprets a specified value as a Short using a specified pattern and locale.
 

Method Detail

parse

Short parse(Object value)
Creates a Short instance assuming default platform locale. Depending on the type of its argument, this method tries to make the most precise conversion.

If conversion is successful, the method returns the resulting Short object, otherwise it throws an exception.

Parameters:
value - The value to be converted.
Returns:
A short object.
Throws:
Exception - If the parameter is invalid.

parse

Short parse(String value,
            String pattern)
Creates a Short instance using a specified pattern and locale.

If conversion is successful, the method returns the resulting Short object, otherwise it throws an exception.

Parameters:
value - The value to be converted.
pattern - The pattern used to validate the value against or null to use the default for the Locale. Please see DecimalFormatSymbols
Returns:
A short object.
Throws:
Exception - If the parameter is invalid.

parse

Short parse(String value,
            String pattern,
            String locale)
Interprets a specified value as a Short using a specified pattern and locale.

If conversion is successful, the method returns the resulting Short object, otherwise it throws an exception.

Parameters:
value - The value to be converted.
pattern - The pattern used to validate the value against or null to use the default for the Locale. Please see DecimalFormatSymbols
locale - The locale to use for the format, system default if null. Please see Locale.
Returns:
A short object.
Throws:
Exception - If the parameter is invalid.

isInRange

boolean isInRange(Object value,
                  Object min,
                  Object max)
Checks if the value is within a specified range, inclusive.

Parameters:
value - The value in question.
min - Start of the range.
max - End of the range.
Returns:
true if value is within the range specified, inclusive of the min and max parameters.
Throws:
Exception - If any of the parameters cannot be converted to a short.

isLess

boolean isLess(Object a,
               Object b)
Checks if the value is less than a specified threshold.

Parameters:
a - The integer value to compare to.
b - The integer value to compare with.
Returns:
true if the value of the parameter a is less then the value of the parameter b.
Throws:
Exception - If any of the parameters cannot be converted to a short.

isLessOrEqual

boolean isLessOrEqual(Object a,
                      Object b)
Checks if the value is less than or equals to a specified threshold.

Parameters:
a - The integer value to compare to.
b - The integer value to compare with.
Returns:
true if the value of the parameter a is less or equal to the value of the parameter b.
Throws:
Exception - If any of the parameters cannot be converted to a short.

isGreater

boolean isGreater(Object a,
                  Object b)
Checks if the value is greater than a specified threshold.

Parameters:
a - The short value to compare to.
b - The short value to compare with.
Returns:
true if the value of the parameter a is greater then the value of the parameter b.
Throws:
Exception - If any of the parameters cannot be converted to a short.

isGreaterOrEqual

boolean isGreaterOrEqual(Object a,
                         Object b)
Checks if the value is less than or equals to a specified threshold.

Parameters:
a - The short value to compare to.
b - The short value to compare with.
Returns:
true if the value of the parameter a is greater or equal to the value of the parameter b.
Throws:
Exception - If any of the parameters cannot be converted to a short.

isEqual

boolean isEqual(Object a,
                Object b)
Checks if two values are equal, if treated as short integers.

Parameters:
a - The first integer value.
b - The second integer value.
Returns:
True if the 2 values are equal.
Throws:
Exception - If any of the parameters cannot be converted to a short integer.

isValid

boolean isValid(String value)
Interprets a specified value as a Short (using default platform locale).

If conversion is successful, the method returns resulting Short object, otherwise it returns null.

Parameters:
value -

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.