Package dev.iahmadgad.json
Class Validator
java.lang.Object
dev.iahmadgad.json.Validator
Validator Class.
- Since:
- 0.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringgetPresentedType(String string) Gets the variable type presented by String.protected static StringGets type of the specified object.protected static ObjectgetVariable(String string) Gets the variable presented by String.protected static booleanChecks if value is boolean.protected static booleanChecks if value is double.protected static booleanChecks if value is int.protected static booleanisJSONArray(Object object) Checks if object is JSONArray.protected static booleanisJSONObject(Object object) Checks if object is JSONObject.protected static booleanChecks if object is String.protected static booleanChecks if object is valid to be put into JSONObject or added to JSONArray.protected static booleanChecks if ArrayList is valid to be converted to JSONArray.protected static booleanpresentsBoolean(String string) Checks if string presents a boolean valueprotected static booleanpresentsDouble(String string) Checks if string presents a double valueprotected static booleanpresentsInteger(String string) Checks if string presents an int valueprotected static booleanpresentsString(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
-