クラス EnvaliFieldHelper

java.lang.Object
org.thinkit.framework.envali.helper.EnvaliFieldHelper

public final class EnvaliFieldHelper
extends Object
The helper class that provides access to the field values defined in ValidatableEntity .
導入されたバージョン:
1.0.0
  • メソッドの詳細

    • of

      public static EnvaliFieldHelper of​(@NonNull @NonNull ValidatableEntity validatableEntity, @NonNull @NonNull Field field)
      Returns the new instance of EnvaliFieldHelper object;
      パラメータ:
      validatableEntity - The validatable entity
      field - The field
      戻り値:
      The new instance of EnvaliFieldHelper object
      例外:
      NullPointerException - If null is passed as an argument
    • get

      public Object get()
      Returns an object value from a field object.
      戻り値:
      An object field value
      例外:
      UnsupportedOperationException - If a different object is passed during the reflection process, otherwise if an attempt is made to access an area that does not meet the permissions during the reflection process
    • getEntityName

      public String getEntityName()
      Returns the name of validatable entity.
      戻り値:
      The field type
    • getEntitySimpleName

      public String getEntitySimpleName()
      Returns the simple name of validatable entity.
      戻り値:
      The field type
    • getGenericType

      public Type getGenericType()
      Returns the generic type.
      戻り値:
      The generic type
    • getName

      public String getName()
      Returns the field name.
      戻り値:
      The field name
    • getString

      public String getString()
      Returns a string value from a field object.
      戻り値:
      A string field value
    • getInt

      public int getInt()
      Returns an int value from a field object.
      戻り値:
      An int field value
    • getLong

      public long getLong()
      Returns a long value from a field object.
      戻り値:
      A long field value
    • getShort

      public short getShort()
      Returns a short value from a field object.
      戻り値:
      A short field value
    • getByte

      public byte getByte()
      Returns a byte value from a field object.
      戻り値:
      A byte field value
    • getFloat

      public float getFloat()
      Returns a float value from a field object.
      戻り値:
      A float field value
    • getDouble

      public double getDouble()
      Returns a double value from a field object.
      戻り値:
      A double field value
    • getArray

      public Object[] getArray()
      Returns an array from a field object.
      戻り値:
      A field object of array
    • getList

      public List<?> getList()
      Returns a list from a field object.
      戻り値:
      A field object of list
    • getMap

      public Map<?,​?> getMap()
      Returns a map from a field object.
      戻り値:
      A field object of map
    • getSet

      public Set<?> getSet()
      Returns a set from a field object.
      戻り値:
      A field object of set
    • getValidatableEntityList

      public List<ValidatableEntity> getValidatableEntityList()
      Returns a list of validatable entity from a field object.

      This method was created to get a ValidatableEntity in the strategy class corresponding to the NestedEntity annotation. When the strategy class corresponding to the NestedEntity annotation is started, it is already guaranteed that the field object is a ValidatableEntity, so there is no need to check when casting.

      戻り値:
      A field object of validatable entity list
    • getValidatableEntityMap

      public Map<?,​ValidatableEntity> getValidatableEntityMap()
      Returns a map of validatable entity from a field object.

      This method was created to get a ValidatableEntity in the strategy class corresponding to the NestedEntity annotation. When the strategy class corresponding to the NestedEntity annotation is started, it is already guaranteed that the field object is a ValidatableEntity, so there is no need to check when casting.

      戻り値:
      A field object of validatable entity map
    • getValidatableEntitySet

      public Set<ValidatableEntity> getValidatableEntitySet()
      Returns a set of validatable entity from a field object.

      This method was created to get a ValidatableEntity in the strategy class corresponding to the NestedEntity annotation. When the strategy class corresponding to the NestedEntity annotation is started, it is already guaranteed that the field object is a ValidatableEntity, so there is no need to check when casting.

      戻り値:
      A field object of validatable entity set
    • getValidatableEntity

      public ValidatableEntity getValidatableEntity()
      Returns a validatable entity from a field object.
      戻り値:
      A field object of validatable entity
    • isString

      public boolean isString()
      Tests if the data type of the field is String.
      戻り値:
      true if the data type of field is String, otherwise false
    • isInteger

      public boolean isInteger()
      Tests if the data type of the field is Integer.
      戻り値:
      true if the data type of field is Integer, otherwise false
    • isLong

      public boolean isLong()
      Tests if the data type of the field is Long.
      戻り値:
      true if the data type of field is Long, otherwise false
    • isShort

      public boolean isShort()
      Tests if the data type of the field is Short.
      戻り値:
      true if the data type of field is Short, otherwise false
    • isByte

      public boolean isByte()
      Tests if the data type of the field is Byte.
      戻り値:
      true if the data type of field is Byte, otherwise false
    • isFloat

      public boolean isFloat()
      Tests if the data type of the field is Float.
      戻り値:
      true if the data type of field is Float, otherwise false
    • isArray

      public boolean isArray()
      Tests if the data type of the field is Array.
      戻り値:
      true if the data type of field is Array, otherwise false
    • isList

      public boolean isList()
      Tests if the data type of the field is List.
      戻り値:
      true if the data type of field is List, otherwise false
    • isMap

      public boolean isMap()
      Tests if the data type of the field is Map.
      戻り値:
      true if the data type of field is Map, otherwise false
    • isSet

      public boolean isSet()
      Tests if the data type of the field is Set.
      戻り値:
      true if the data type of field is Set, otherwise false
    • isCollection

      public boolean isCollection()
      Tests if the data type of the field is collection.
      戻り値:
      true if the data type of field is List, Map or Set, otherwise false
    • isDouble

      public boolean isDouble()
      Tests if the data type of the field is Double.
      戻り値:
      true if the data type of field is Double, otherwise false
    • isValidatableEntity

      public boolean isValidatableEntity()
      Tests if the data type of the field is ValidatableEntity .
      戻り値:
      true if the data type of field is ValidatableEntity , otherwise false
    • hasParameterizedValidatableEntity

      public boolean hasParameterizedValidatableEntity()
      Tests if the field has ValidatableEntity as parameterized data type.
      戻り値:
      true if the field has ValidatableEntity as parameterized data type, otherwise false
    • toString

      public String toString()
      オーバーライド:
      toString クラス内 Object
    • equals

      public boolean equals​(Object o)
      オーバーライド:
      equals クラス内 Object
    • hashCode

      public int hashCode()
      オーバーライド:
      hashCode クラス内 Object
    • getType

      public Class<?> getType()
      The field data type
    • getParameterizedType

      public ParameterizedType getParameterizedType()
      The list of parameterized validatable entity
    • getParameterizedValidatableEntities

      public List<Class<?>> getParameterizedValidatableEntities()
      The list of parameterized validatable entity