protected K getPeriodicalWithFakeDates(K periodical, Date beginDate, Date endDate) throws CloneNotSupportedException { K partOfPeriodical = (K) periodical.clone(); partOfPeriodical.setBeginDate(beginDate); partOfPeriodical.setEndDate(endDate); return partOfPeriodical; }
protected K makePeriodicalCoversOnlyOneYear(K periodical, Date yearBeginDate, Date yearEndDate) { if (periodical.getBeginDate().before(yearBeginDate) && periodical.getEndDate().after(yearBeginDate)) { periodical.setBeginDate(yearBeginDate); } if (periodical.getBeginDate().before(yearEndDate) && periodical.getEndDate().after(yearEndDate)) { periodical.setEndDate(yearEndDate); } return periodical; }