Enum Constant and Description |
---|
FRIDAY
周五
|
MONDAY
周一
|
SATURDAY
周六
|
SUNDAY
周日
|
THURSDAY
周四
|
TUESDAY
周二
|
WEDNESDAY
周三
|
Modifier and Type | Method and Description |
---|---|
int |
getIso8601Value()
获取ISO8601规范的int值,from 1 (Monday) to 7 (Sunday).
|
int |
getValue()
获得星期对应
Calendar 中的Week值 |
static Week |
of(DayOfWeek dayOfWeek)
将
DayOfWeek 星期相关值转换为Week枚举对象 |
static Week |
of(int calendarWeekIntValue)
将
Calendar 星期相关值转换为Week枚举对象 |
static Week |
of(String name)
解析别名为Week对象,别名如:sun或者SUNDAY,不区分大小写
|
String |
toChinese()
转换为中文名
|
String |
toChinese(String weekNamePre)
转换为中文名
|
DayOfWeek |
toJdkDayOfWeek()
转换为
DayOfWeek |
static Week |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Week[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Week SUNDAY
public static final Week MONDAY
public static final Week TUESDAY
public static final Week WEDNESDAY
public static final Week THURSDAY
public static final Week FRIDAY
public static final Week SATURDAY
public static Week[] values()
for (Week c : Week.values()) System.out.println(c);
public static Week valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getIso8601Value()
public String toChinese()
public String toChinese(String weekNamePre)
weekNamePre
- 表示星期的前缀,例如前缀为“星期”,则返回结果为“星期一”;前缀为”周“,结果为“周一”public static Week of(String name) throws IllegalArgumentException
name
- 别名值IllegalArgumentException
- 如果别名无对应的枚举,抛出此异常Copyright © 2024. All rights reserved.