Package com.adaptris.util
Class TimeInterval
java.lang.Object
com.adaptris.util.TimeInterval
Class that describes a time unit for use within the adapter.
- See Also:
In the adapter configuration file this class is aliased as time-interval which is the preferred alternative to the fully qualified classname when building your configuration.
-
Constructor Summary
ConstructorsConstructorDescriptionTimeInterval(Long interval, String unit) TimeInterval(Long interval, TimeUnit unit) -
Method Summary
Modifier and TypeMethodDescriptiongetUnit()voidsetInterval(Long interval) Define the actual interval for this interval.voidDefine the unit for this interval.longstatic longtoMillisecondsDefaultIfNull(TimeInterval t, long defaultMs) static longtoMillisecondsDefaultIfNull(TimeInterval t, TimeInterval defaultInterval) static longtoSecondsDefaultIfNull(TimeInterval t, long defaultMs) static longtoSecondsDefaultIfNull(TimeInterval t, TimeInterval defaultInterval) toString()
-
Constructor Details
-
TimeInterval
public TimeInterval() -
TimeInterval
-
TimeInterval
-
-
Method Details
-
toMilliseconds
public long toMilliseconds() -
toString
-
getUnit
-
setUnit
Define the unit for this interval.- Parameters:
unit- the unit, if not specified (or unknown) defaults toTimeUnit.SECONDS
-
getInterval
-
setInterval
Define the actual interval for this interval.- Parameters:
interval- the interval, if not specified defaults to 10.
-
toMillisecondsDefaultIfNull
-
toMillisecondsDefaultIfNull
-
toSecondsDefaultIfNull
-
toSecondsDefaultIfNull
-