mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-25 11:45:49 +01:00
PersistenceExtensions: Re-add deprecated evolutionRate variant (#4212)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
This commit is contained in:
parent
d9685ca9c0
commit
94572aa7c8
@ -1726,6 +1726,26 @@ public class PersistenceExtensions {
|
||||
return internalEvolutionRateBetween(item, null, timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the evolution rate of the state of a given {@link Item} between two points in time.
|
||||
* The default {@link PersistenceService} is used.
|
||||
*
|
||||
* @param item the item to get the evolution rate value for
|
||||
* @param begin the beginning point in time
|
||||
* @param end the end point in time
|
||||
* @return the evolution rate in percent (positive and negative) in the given interval, or <code>null</code> if
|
||||
* there is no default persistence service available, the default persistence service is not a
|
||||
* {@link QueryablePersistenceService}, or if there are no persisted state for the given <code>item</code>
|
||||
* at the given interval, or if there is a state but it is zero (which would cause a
|
||||
* divide-by-zero error)
|
||||
*/
|
||||
@Deprecated
|
||||
public static @Nullable DecimalType evolutionRate(Item item, ZonedDateTime begin, ZonedDateTime end) {
|
||||
LoggerFactory.getLogger(PersistenceExtensions.class).info(
|
||||
"The evolutionRate method has been deprecated and will be removed in a future version, use evolutionRateBetween instead.");
|
||||
return internalEvolutionRateBetween(item, begin, end);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the evolution rate of the state of a given {@link Item} between two points in time.
|
||||
* The default {@link PersistenceService} is used.
|
||||
@ -1803,6 +1823,29 @@ public class PersistenceExtensions {
|
||||
return internalEvolutionRateBetween(item, null, timestamp, serviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the evolution rate of the state of a given {@link Item} between two points in time.
|
||||
* The {@link PersistenceService} identified by the <code>serviceId</code> is used.
|
||||
*
|
||||
* @param item the {@link Item} to get the evolution rate value for
|
||||
* @param begin the beginning point in time
|
||||
* @param end the end point in time
|
||||
* @param serviceId the name of the {@link PersistenceService} to use
|
||||
* @return the evolution rate in percent (positive and negative) in the given interval, or <code>null</code> if
|
||||
* the persistence service given by <code>serviceId</code> is not available or is not a
|
||||
* {@link QueryablePersistenceService}, or if there is no persisted state for the given
|
||||
* <code>item</code> at the given <code>begin</code> and <code>end</code> using the persistence service
|
||||
* given by <code>serviceId</code>, or if there is a state but it is zero (which would cause a
|
||||
* divide-by-zero error)
|
||||
*/
|
||||
@Deprecated
|
||||
public static @Nullable DecimalType evolutionRate(Item item, ZonedDateTime begin, ZonedDateTime end,
|
||||
String serviceId) {
|
||||
LoggerFactory.getLogger(PersistenceExtensions.class).info(
|
||||
"The evolutionRate method has been deprecated and will be removed in a future version, use evolutionRateBetween instead.");
|
||||
return internalEvolutionRateBetween(item, begin, end, serviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the evolution rate of the state of a given {@link Item} between two points in time.
|
||||
* The {@link PersistenceService} identified by the <code>serviceId</code> is used.
|
||||
|
Loading…
Reference in New Issue
Block a user