Class TimestampAdapter

java.lang.Object
org.apache.johnzon.mapper.converter.TimestampAdapter
All Implemented Interfaces:
Adapter<Date,Long>, MapperConverter

public class TimestampAdapter extends Object implements Adapter<Date,Long>
  • Constructor Details

    • TimestampAdapter

      public TimestampAdapter()
  • Method Details

    • to

      public Date to(Long aLong)
      Description copied from interface: Adapter
      Transfer JSONTYPE_TYPE from JSON to POJO as POJO_TYPE.
      Specified by:
      to in interface Adapter<Date,Long>
      Parameters:
      aLong - the JSON type
      Returns:
      the equivalent Java type
    • from

      public Long from(Date date)
      Description copied from interface: Adapter
      Take the POJO_TYPE object A from a POJO an convert it to JSON_TYPE which will be inserted into the JSON output.
      Specified by:
      from in interface Adapter<Date,Long>
      Parameters:
      date - the Java type
      Returns:
      the equivalent JSON type