注釈型 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 on ErrorType , and ErrorType.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 on ErrorType , and empty ("") is set as the default.
    short shortFrom
    Returns the lower limit of short type.
  • 要素の詳細

    • errorType

      ErrorType errorType
      Returns the error type based on ErrorType , and ErrorType.RUNTIME is set as the default.
      戻り値:
      The error type based on the ErrorType
      デフォルト:
      RUNTIME
    • message

      String message
      Returns the error type based on ErrorType , and empty ("") is set as the default.
      戻り値:
      The message
      デフォルト:
      ""
    • intFrom

      int intFrom
      Returns the lower limit of int type. The default value is Integer.MIN_VALUE .
      戻り値:
      The lower limit of int type
      導入されたバージョン:
      1.0.2
      デフォルト:
      -2147483648
    • longFrom

      long longFrom
      Returns the lower limit of long type. The default value is Long.MIN_VALUE .
      戻り値:
      The lower limit of long type
      導入されたバージョン:
      1.0.2
      デフォルト:
      -9223372036854775808L
    • floatFrom

      float floatFrom
      Returns the lower limit of float type. The default value is Float.MIN_VALUE .
      戻り値:
      The lower limit of float type
      導入されたバージョン:
      1.0.2
      デフォルト:
      1.4E-45f
    • doubleFrom

      double doubleFrom
      Returns the lower limit of double type. The default value is Double.MIN_VALUE .
      戻り値:
      The lower limit of double type
      導入されたバージョン:
      1.0.2
      デフォルト:
      4.9E-324
    • shortFrom

      short shortFrom
      Returns the lower limit of short type. The default value is Short.MIN_VALUE .
      戻り値:
      The lower limit of short type
      導入されたバージョン:
      1.0.2
      デフォルト:
      -32768
    • byteFrom

      byte byteFrom
      Returns the lower limit of byte type. The default value is Byte.MIN_VALUE .
      戻り値:
      The lower limit of byte type
      導入されたバージョン:
      1.0.2
      デフォルト:
      (byte)0x80