com.cumulocity.model
Class DateConverter

java.lang.Object
  extended by com.cumulocity.model.DateConverter
All Implemented Interfaces:
org.svenson.converter.TypeConverter

public class DateConverter
extends Object
implements org.svenson.converter.TypeConverter

Provides methods to convert Date to/from String, so that it can be used as JSON object where required.


Constructor Summary
DateConverter()
           
 
Method Summary
static String date2String(Date in)
          Return a String representation of the given Date.
 Object fromJSON(Object in)
           
static Date string2Date(String in)
          Convert a String into a date using ISODateTimeFormat;
 Object toJSON(Object in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateConverter

public DateConverter()
Method Detail

fromJSON

public Object fromJSON(Object in)
Specified by:
fromJSON in interface org.svenson.converter.TypeConverter

string2Date

public static Date string2Date(String in)
Convert a String into a date using ISODateTimeFormat;

Parameters:
in -
Returns:

toJSON

public Object toJSON(Object in)
Specified by:
toJSON in interface org.svenson.converter.TypeConverter

date2String

public static String date2String(Date in)
Return a String representation of the given Date.

Parameters:
in -
Returns:


Copyright © 2013 (C) Cumulocity GmbH. All Rights Reserved.