001/* Copyright (C) 2014 konik.io 002 * 003 * This file is part of the Konik library. 004 * 005 * The Konik library is free software: you can redistribute it and/or modify 006 * it under the terms of the GNU Affero General Public License as 007 * published by the Free Software Foundation, either version 3 of the 008 * License, or (at your option) any later version. 009 * 010 * The Konik library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU Affero General Public License for more details. 014 * 015 * You should have received a copy of the GNU Affero General Public License 016 * along with the Konik library. If not, see <http://www.gnu.org/licenses/>. 017 */ 018package io.konik.zugferd.entity; 019 020import io.konik.zugferd.unqualified.ZfDate; 021 022import javax.validation.constraints.NotNull; 023import javax.xml.bind.annotation.XmlElement; 024import javax.xml.bind.annotation.XmlType; 025import java.io.Serializable; 026 027/** 028 * = The period of time 029 * 030 */ 031@XmlType(name = "SpecifiedPeriodType", propOrder = { "start", "end" }) 032public class Period implements Serializable { 033 034 @XmlElement(name = "StartDateTime") 035 private ZfDate start; 036 037 @XmlElement(name = "EndDateTime") 038 private ZfDate end; 039 040 041 /** 042 * Gets the start date time. 043 * 044 * @return the start date time 045 */ 046 @NotNull 047 public ZfDate getStart() { 048 return start; 049 } 050 051 /** 052 * Sets the start date time. 053 * 054 * @param start the new start date time 055 * @return the period 056 */ 057 public Period setStart(ZfDate start) { 058 this.start = start; 059 return this; 060 } 061 062 /** 063 * Gets the end date time. 064 * 065 * @return the end date time 066 */ 067 @NotNull 068 public ZfDate getEnd() { 069 return end; 070 } 071 072 /** 073 * Sets the end date time. 074 * 075 * @param end the new end date time 076 * @return the period 077 */ 078 public Period setEnd(ZfDate end) { 079 this.end = end; 080 return this; 081 } 082 083}