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

net.fortuna.ical4j.model.rfc5545.CreatedPropertyRule Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
package net.fortuna.ical4j.model.rfc5545;

import java.text.ParseException;

import net.fortuna.ical4j.model.Rfc5545PropertyRule;
import net.fortuna.ical4j.model.property.Created;

/**
 * 
 * @author daniel grigore
 *
 */
public class CreatedPropertyRule implements Rfc5545PropertyRule {

    private static final String UTC_MARKER = "Z";

    @Override
    public void applyTo(Created created) {
        if (created.isUtc() || created.getTimeZone() != null) {
            return;
        }
        try {
            created.setValue(created.getValue() + UTC_MARKER);
        } catch (ParseException e) {
            // Let the value as it is
        }
    }

    @Override
    public Class getSupportedType() {
        return Created.class;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy