Class TimeRange
java.lang.Object
cloud.opencode.base.date.range.TimeRange
Deprecated.
TimeRange - Compatibility wrapper for LocalTimeRange
时间范围 - LocalTimeRange的兼容性包装器
This class provides a compatibility layer for the extra.LocalTimeRange class, offering the same functionality with a simpler name for legacy code compatibility.
此类为extra.LocalTimeRange类提供兼容层,使用更简单的名称以兼容遗留代码。
Features | 主要功能:
- Compatibility wrapper for LocalTimeRange - LocalTimeRange的兼容性包装器
- Containment and overlap checking - 包含和重叠检查
- Duration calculation - 持续时间计算
- Intersection and span operations - 交集和跨度操作
Usage Examples | 使用示例:
TimeRange range = TimeRange.of(LocalTime.of(9, 0), LocalTime.of(17, 0));
Duration duration = range.toDuration();
boolean contains = range.contains(LocalTime.of(12, 0));
Security | 安全性:
- Thread-safe: Yes (immutable, delegates to immutable LocalTimeRange) - 线程安全: 是(不可变,委托给不可变的LocalTimeRange)
- Null-safe: No (delegates null handling to LocalTimeRange) - 空值安全: 否(空值处理委托给LocalTimeRange)
- Since:
- JDK 25, opencode-base-date V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic TimeRangeDeprecated.Creates a TimeRange for business hours (9:00 - 17:00) 创建工作时间范围(9:00 - 17:00)booleanDeprecated.booleanDeprecated.booleanDeprecated.static TimeRangefrom(LocalTimeRange range) Deprecated.Creates a TimeRange from a LocalTimeRange 从LocalTimeRange创建TimeRangegetEnd()Deprecated.getStart()Deprecated.inthashCode()Deprecated.intersection(TimeRange other) Deprecated.booleanisEmpty()Deprecated.static TimeRangeDeprecated.Creates a TimeRange 创建时间范围booleanDeprecated.Deprecated.Deprecated.Deprecated.Converts to LocalTimeRange 转换为LocalTimeRangetoString()Deprecated.
-
Method Details
-
of
-
businessHours
Deprecated.Creates a TimeRange for business hours (9:00 - 17:00) 创建工作时间范围(9:00 - 17:00)- Returns:
- the business hours TimeRange | 工作时间范围
-
from
Deprecated.Creates a TimeRange from a LocalTimeRange 从LocalTimeRange创建TimeRange- Parameters:
range- the LocalTimeRange | LocalTimeRange- Returns:
- the TimeRange | 时间范围
-
getStart
Deprecated. -
getEnd
Deprecated. -
toDuration
Deprecated. -
isEmpty
public boolean isEmpty()Deprecated. -
contains
Deprecated. -
overlaps
Deprecated. -
encloses
Deprecated. -
intersection
-
span
-
toLocalTimeRange
Deprecated.Converts to LocalTimeRange 转换为LocalTimeRange- Returns:
- the LocalTimeRange | LocalTimeRange
-
equals
-
hashCode
-
toString
-
LocalTimeRangeinstead