Class Validator

java.lang.Object
dev.iahmadgad.json.Validator

public class Validator extends Object
Validator Class.
Since:
0.3
  • Constructor Details

    • Validator

      public Validator()
  • Method Details

    • getType

      protected static String getType(Object object)
      Gets type of the specified object.
      Parameters:
      object -
      Returns:
      type of of the specified object
    • isValid

      protected static boolean isValid(ArrayList<Object> list)
      Checks if ArrayList is valid to be converted to JSONArray.
      Parameters:
      list -
      Returns:
      true if it's valid and false if it's not
    • isValid

      protected static boolean isValid(Object object)
      Checks if object is valid to be put into JSONObject or added to JSONArray.
      Parameters:
      object -
      Returns:
      true if it's valid and false if it's not
    • isJSONObject

      protected static boolean isJSONObject(Object object)
      Checks if object is JSONObject.
      Parameters:
      object -
      Returns:
      true if it's a JSONObject and false if it's not
    • isJSONArray

      protected static boolean isJSONArray(Object object)
      Checks if object is JSONArray.
      Parameters:
      object -
      Returns:
      true if it's a JSONArray and false if it's not
    • isString

      protected static boolean isString(Object object)
      Checks if object is String.
      Parameters:
      object -
      Returns:
      true if it's a String and false if it's not
    • isBoolean

      protected static boolean isBoolean(Object value)
      Checks if value is boolean.
      Parameters:
      value -
      Returns:
      true if it's a boolean and false if it's not
    • isInteger

      protected static boolean isInteger(Object value)
      Checks if value is int.
      Parameters:
      value -
      Returns:
      true if it's an int and false if it's not
    • isDouble

      protected static boolean isDouble(Object value)
      Checks if value is double.
      Parameters:
      value -
      Returns:
      true if it's a double and false if it's not
    • getVariable

      protected static Object getVariable(String string)
      Gets the variable presented by String.
      Parameters:
      string -
      Returns:
      the variable presented by String
    • getPresentedType

      protected static String getPresentedType(String string)
      Gets the variable type presented by String.
      Parameters:
      string -
      Returns:
      the variable type presented by String
    • presentsString

      protected static boolean presentsString(String string)
      Checks if string presents a String value
      Parameters:
      string -
      Returns:
      true if it presents a String value and false if it's not
    • presentsBoolean

      protected static boolean presentsBoolean(String string)
      Checks if string presents a boolean value
      Parameters:
      string -
      Returns:
      true if it presents a String value and false if it's not
    • presentsDouble

      protected static boolean presentsDouble(String string)
      Checks if string presents a double value
      Parameters:
      string -
      Returns:
      true if it presents a double value and false if it's not
    • presentsInteger

      protected static boolean presentsInteger(String string)
      Checks if string presents an int value
      Parameters:
      string -
      Returns:
      true if it presents an int value and false if it's not