python-awips/dynamicserialize/adapters/DateAdapter.py

25 lines
527 B
Python
Raw Permalink Normal View History

2018-09-05 15:52:38 -06:00
#
# Adapter for java.util.Date
#
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 12/06/10 dgilling Initial Creation.
#
from dynamicserialize.dstypes.java.util import Date
ClassAdapter = 'java.util.Date'
2018-10-14 17:37:08 -06:00
2018-09-05 15:52:38 -06:00
def serialize(context, date):
context.writeI64(date.getTime())
2018-10-14 17:37:08 -06:00
2018-09-05 15:52:38 -06:00
def deserialize(context):
result = Date()
result.setTime(context.readI64())
2018-09-06 12:11:36 -06:00
return result