python-awips/dynamicserialize/adapters/DateAdapter.py

29 lines
537 B
Python
Raw Normal View History

2015-06-18 10:25:33 -06:00
##
##
#
# Adapter for java.util.Date
2016-03-16 16:32:17 -05:00
#
#
2015-06-18 10:25:33 -06:00
# SOFTWARE HISTORY
2016-03-16 16:32:17 -05:00
#
2015-06-18 10:25:33 -06:00
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 12/06/10 dgilling Initial Creation.
2016-03-16 16:32:17 -05:00
#
#
2015-06-18 10:25:33 -06:00
#
from dynamicserialize.dstypes.java.util import Date
ClassAdapter = 'java.util.Date'
def serialize(context, date):
context.writeI64(date.getTime())
2016-03-16 16:32:17 -05:00
2015-06-18 10:25:33 -06:00
def deserialize(context):
result = Date()
result.setTime(context.readI64())
return result