@Test(expectedExceptions = IllegalArgumentException.class) public void testValidTimeSetterWithInvalidValues() { TemporalElement elementMock = mock(TemporalElement.class, withSettings() .useConstructor(GradoopId.get(), "", null, null, null) .defaultAnswer(CALLS_REAL_METHODS)); elementMock.setValidTime(Tuple2.of(2L, 1L)); }
public void setValidTime(Tuple2<Long, Long> validTime) { Objects.requireNonNull(validTime); Objects.requireNonNull(validTime.f0); Objects.requireNonNull(validTime.f1); if (validTime.f0 > validTime.f1) { throw new IllegalArgumentException("valid-from time can not be after valid-to time"); } this.validTime = validTime; }
TemporalElement extends EPGMElement implements Element { public void setValidTime(Tuple2<Long, Long> validTime) { Objects.requireNonNull(validTime); Objects.requireNonNull(validTime.f0); Objects.requireNonNull(validTime.f1); if (validTime.f0 > validTime.f1) { throw new IllegalArgumentException("valid-from time can not be after valid-to time"); } this.validTime = validTime; } }
TemporalElement extends EPGMElement implements Element { public void setValidTime(Tuple2<Long, Long> validTime) { Objects.requireNonNull(validTime); Objects.requireNonNull(validTime.f0); Objects.requireNonNull(validTime.f1); if (validTime.f0 > validTime.f1) { throw new IllegalArgumentException("valid-from time can not be after valid-to time"); } this.validTime = validTime; } TemporalElement();   TemporalElement(GradoopId id, String label, Properties properties, Long validFrom, Long validTo); }
TemporalElement extends EPGMElement implements Element { public void setValidTime(Tuple2<Long, Long> validTime) { Objects.requireNonNull(validTime); Objects.requireNonNull(validTime.f0); Objects.requireNonNull(validTime.f1); if (validTime.f0 > validTime.f1) { throw new IllegalArgumentException("valid-from time can not be after valid-to time"); } this.validTime = validTime; } TemporalElement();   TemporalElement(GradoopId id, String label, Properties properties, Long validFrom, Long validTo); Tuple2<Long, Long> getTransactionTime(); void setTransactionTime(Tuple2<Long, Long> transactionTime); Tuple2<Long, Long> getValidTime(); void setValidTime(Tuple2<Long, Long> validTime); Tuple2<Long, Long> getTimeByDimension(TimeDimension dimension); Long getValidFrom(); void setValidFrom(long validFrom); Long getValidTo(); void setValidTo(long validTo); Long getTxFrom(); void setTxFrom(long txFrom); Long getTxTo(); void setTxTo(long txTo); @Override String toString(); }
TemporalElement extends EPGMElement implements Element { public void setValidTime(Tuple2<Long, Long> validTime) { Objects.requireNonNull(validTime); Objects.requireNonNull(validTime.f0); Objects.requireNonNull(validTime.f1); if (validTime.f0 > validTime.f1) { throw new IllegalArgumentException("valid-from time can not be after valid-to time"); } this.validTime = validTime; } TemporalElement();   TemporalElement(GradoopId id, String label, Properties properties, Long validFrom, Long validTo); Tuple2<Long, Long> getTransactionTime(); void setTransactionTime(Tuple2<Long, Long> transactionTime); Tuple2<Long, Long> getValidTime(); void setValidTime(Tuple2<Long, Long> validTime); Tuple2<Long, Long> getTimeByDimension(TimeDimension dimension); Long getValidFrom(); void setValidFrom(long validFrom); Long getValidTo(); void setValidTo(long validTo); Long getTxFrom(); void setTxFrom(long txFrom); Long getTxTo(); void setTxTo(long txTo); @Override String toString(); static final Long DEFAULT_TIME_FROM; static final Long DEFAULT_TIME_TO; }