Package dev.iahmadgad.json
Class Validator
java.lang.Object
dev.iahmadgad.json.Validator
Validator Class.
- Since:
- 0.3
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String
getPresentedType
(String string) Gets the variable type presented by String.protected static String
Gets type of the specified object.protected static Object
getVariable
(String string) Gets the variable presented by String.protected static boolean
Checks if value is boolean.protected static boolean
Checks if value is double.protected static boolean
Checks if value is int.protected static boolean
isJSONArray
(Object object) Checks if object is JSONArray.protected static boolean
isJSONObject
(Object object) Checks if object is JSONObject.protected static boolean
Checks if object is String.protected static boolean
Checks if object is valid to be put into JSONObject or added to JSONArray.protected static boolean
Checks if ArrayList is valid to be converted to JSONArray.protected static boolean
presentsBoolean
(String string) Checks if string presents a boolean valueprotected static boolean
presentsDouble
(String string) Checks if string presents a double valueprotected static boolean
presentsInteger
(String string) Checks if string presents an int valueprotected static boolean
presentsString
(String string) Checks if string presents a String value
-
Constructor Details
-
Validator
public Validator()
-
-
Method Details
-
getType
Gets type of the specified object.- Parameters:
object
-- Returns:
- type of of the specified object
-
isValid
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
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
Checks if object is JSONObject.- Parameters:
object
-- Returns:
- true if it's a JSONObject and false if it's not
-
isJSONArray
Checks if object is JSONArray.- Parameters:
object
-- Returns:
- true if it's a JSONArray and false if it's not
-
isString
Checks if object is String.- Parameters:
object
-- Returns:
- true if it's a String and false if it's not
-
isBoolean
Checks if value is boolean.- Parameters:
value
-- Returns:
- true if it's a boolean and false if it's not
-
isInteger
Checks if value is int.- Parameters:
value
-- Returns:
- true if it's an int and false if it's not
-
isDouble
Checks if value is double.- Parameters:
value
-- Returns:
- true if it's a double and false if it's not
-
getVariable
Gets the variable presented by String.- Parameters:
string
-- Returns:
- the variable presented by String
-
getPresentedType
Gets the variable type presented by String.- Parameters:
string
-- Returns:
- the variable type presented by String
-
presentsString
Checks if string presents a String value- Parameters:
string
-- Returns:
- true if it presents a String value and false if it's not
-
presentsBoolean
Checks if string presents a boolean value- Parameters:
string
-- Returns:
- true if it presents a String value and false if it's not
-
presentsDouble
Checks if string presents a double value- Parameters:
string
-- Returns:
- true if it presents a double value and false if it's not
-
presentsInteger
Checks if string presents an int value- Parameters:
string
-- Returns:
- true if it presents an int value and false if it's not
-