All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.emc.storageos.model.adapters.CalendarAdapter Maven / Gradle / Ivy

There is a newer version: 3.5.0.0
Show newest version
/*
 * Copyright (c) 2012 EMC Corporation
 * All Rights Reserved
 */

package com.emc.storageos.model.adapters;

import java.util.Calendar;
import javax.xml.bind.annotation.adapters.XmlAdapter;

/**
 * An XML Calendar marshaler based on JAXB API
 */
public class CalendarAdapter extends XmlAdapter {

    @Override
    public Long marshal(Calendar v) throws Exception {
        return v.getTimeInMillis();
    }

    @Override
    public Calendar unmarshal(Long v) throws Exception {
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(v);
        return c;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy