Package com.blackrook.json.converters
Class JSONDateMillisConverter
java.lang.Object
com.blackrook.json.converters.JSONDateMillisConverter
- All Implemented Interfaces:
JSONConverter<Date>
A special converter that converts dates from milliseconds since Epoch to Dates in JSON member data.
- Since:
- 1.3.0
- Author:
- Matthew Tropiano
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetJSONObject
(Date object) Returns a JSON object that represents this object instance (and its contents).getObject
(JSONObject jsonObject) Returns a Java Object that is equivalent to the input JSON Object.
-
Constructor Details
-
JSONDateMillisConverter
public JSONDateMillisConverter()Creates a new converter.
-
-
Method Details
-
getJSONObject
Description copied from interface:JSONConverter
Returns a JSON object that represents this object instance (and its contents). The policy of this method is to help return something that can be converted back to Java viaJSONConverter.getObject(JSONObject)
with close-to or dead-on 100% equivalence.- Specified by:
getJSONObject
in interfaceJSONConverter<Date>
- Parameters:
object
- the object to inspect.- Returns:
- an accurate JSONObject that represents this object.
-
getObject
Description copied from interface:JSONConverter
Returns a Java Object that is equivalent to the input JSON Object.- Specified by:
getObject
in interfaceJSONConverter<Date>
- Parameters:
jsonObject
- the JSON Object to convert.- Returns:
- an accurate object from the JSON.
-