001/*
002 *  Copyright 2020 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.plugins.calendar.icsreader;
017
018import java.util.Date;
019
020import org.ametys.cms.tag.Tag;
021
022import net.fortuna.ical4j.model.component.VEvent;
023
024/**
025 * A holder created principally for recurrent events, so we can have one iteration of this event, using a start and end date of this iteration
026 */
027public class LocalVEvent
028{
029    private VEvent _event;
030    
031    private Date _start;
032    
033    private Date _end;
034    
035    private Tag _tag;
036    
037    /**
038     * Store an event and a start/end date, the currentDay is used when an event is on multiple days, so we know which day is the one used here
039     * @param event the event
040     * @param start start of the iteration of this event (around the current day)
041     * @param end end of the iteration of this event (around the current day)
042     * @param tag the tag used for this ICS
043     */
044    public LocalVEvent(VEvent event, Date start, Date end, Tag tag)
045    {
046        _event = event;
047        _start = start;
048        _end = end;
049        _tag = tag;
050    }
051
052    /**
053     * return the event
054     * @return the event
055     */
056    public VEvent getEvent()
057    {
058        return _event;
059    }
060
061    /**
062     * return the start date of this iteration
063     * @return the start date of this iteration
064     */
065    public Date getStart()
066    {
067        return _start;
068    }
069
070    /**
071     * return the end date of this iteration
072     * @return the end date of this iteration
073     */
074    public Date getEnd()
075    {
076        return _end;
077    }
078
079    /**
080     * return the tag used for this ICS
081     * @return the tag used for this ICS
082     */
083    public Tag getTag()
084    {
085        return _tag;
086    }
087}