注釈型 RequireRangeFrom
@Documented @Target(FIELD) @Retention(RUNTIME) public @interface RequireRangeFrom
An annotation indicating that the value is not under the lower limit.
Specify this annotation for fields that do not allow numbers to exceed the limit as follows. If this annotation is specified for an object of type other than int, long, short, byte, float, double, Integer, Long, Short, Byte, Float or Double, UnsupportedOperationException will always be thrown at runtime.
Specify the expected value for Content Framework:
@ParameterMapping( content = "Parameter" )
public class ConcreteEntity implements ValidatableEntity, Serializable {
@RequireRangeFrom
private int intFrom;
@RequireRangeFrom( ErrorType.RECOVERABLE, message = "failed!" )
private long longFrom;
@RequireRangeFrom( ErrorType.UNRECOVERABLE, message = "failed!" )
private double doubleFrom;
}
Specify the expected value for the annotation:
public class ConcreteEntity implements ValidatableEntity, Serializable {
@RequireRangeFrom( intFrom = 10 )
private int intFrom;
@RequireRangeFrom( longFrom = 10l, ErrorType.RECOVERABLE, message = "failed!" )
private long longFrom;
@RequireRangeFrom( doubleFrom = 10.0d, ErrorType.UNRECOVERABLE, message = "failed!" )
private double doubleFrom;
}
- 導入されたバージョン:
- 1.0.0
-
任意要素の概要
任意要素 修飾子とタイプ 任意要素 説明 byte
byteFrom
Returns the lower limit of byte type.double
doubleFrom
Returns the lower limit of double type.ErrorType
errorType
Returns the error type based onErrorType
, andErrorType.RUNTIME
is set as the default.float
floatFrom
Returns the lower limit of float type.int
intFrom
Returns the lower limit of int type.long
longFrom
Returns the lower limit of long type.String
message
Returns the error type based onErrorType
, and empty (""
) is set as the default.short
shortFrom
Returns the lower limit of short type.
-
要素の詳細
-
errorType
ErrorType errorTypeReturns the error type based onErrorType
, andErrorType.RUNTIME
is set as the default.- 戻り値:
- The error type based on the
ErrorType
- デフォルト:
- RUNTIME
-
message
String messageReturns the error type based onErrorType
, and empty (""
) is set as the default.- 戻り値:
- The message
- デフォルト:
- ""
-
intFrom
int intFromReturns the lower limit of int type. The default value isInteger.MIN_VALUE
.- 戻り値:
- The lower limit of int type
- 導入されたバージョン:
- 1.0.2
- デフォルト:
- -2147483648
-
longFrom
long longFromReturns the lower limit of long type. The default value isLong.MIN_VALUE
.- 戻り値:
- The lower limit of long type
- 導入されたバージョン:
- 1.0.2
- デフォルト:
- -9223372036854775808L
-
floatFrom
float floatFromReturns the lower limit of float type. The default value isFloat.MIN_VALUE
.- 戻り値:
- The lower limit of float type
- 導入されたバージョン:
- 1.0.2
- デフォルト:
- 1.4E-45f
-
doubleFrom
double doubleFromReturns the lower limit of double type. The default value isDouble.MIN_VALUE
.- 戻り値:
- The lower limit of double type
- 導入されたバージョン:
- 1.0.2
- デフォルト:
- 4.9E-324
-
shortFrom
short shortFromReturns the lower limit of short type. The default value isShort.MIN_VALUE
.- 戻り値:
- The lower limit of short type
- 導入されたバージョン:
- 1.0.2
- デフォルト:
- -32768
-
byteFrom
byte byteFromReturns the lower limit of byte type. The default value isByte.MIN_VALUE
.- 戻り値:
- The lower limit of byte type
- 導入されたバージョン:
- 1.0.2
- デフォルト:
- (byte)0x80
-