public enum Weekday extends Enum<Weekday> implements SimpleDatatype<String>
Enum Constant and Description |
---|
FRIDAY
The according weekday.
|
MONDAY
The according weekday.
|
SATURDAY
The according weekday.
|
SUNDAY
The according weekday.
|
THURSDAY
The according weekday.
|
TUESDAY
The according weekday.
|
WEDNESDAY
The according weekday.
|
Modifier and Type | Field and Description |
---|---|
private int |
calendarId |
private String |
title |
private String |
value |
Modifier and Type | Method and Description |
---|---|
Weekday |
add(int days)
|
static Weekday |
fromCalendar(Calendar calendar)
This method gets the
Weekday from the given calendar . |
static Weekday |
fromCalendarId(int calendarId)
This method gets the
Weekday from the given calendar . |
static Weekday |
fromValue(String value)
This method gets the
Weekday for the given value . |
int |
getCalendarId()
|
Weekday |
getNext()
|
Weekday |
getPrevious()
|
String |
getValue()
This method returns the raw value of this datatype.
|
void |
setWeekday(Calendar calendar)
|
String |
toString()
|
static Weekday |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Weekday[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Weekday MONDAY
public static final Weekday TUESDAY
public static final Weekday WEDNESDAY
public static final Weekday THURSDAY
public static final Weekday FRIDAY
public static final Weekday SATURDAY
public static final Weekday SUNDAY
private final String value
private final String title
private final int calendarId
public static Weekday[] values()
for (Weekday c : Weekday.values()) System.out.println(c);
public static Weekday 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 String getValue()
SimpleDatatype
String
, Character
, Boolean
, any type of Number
, any type of java.time.LocalDate
, etc.).getValue
in interface AttributeReadValue<String>
getValue
in interface SimpleDatatype<String>
public int getCalendarId()
Calendar
representing this Weekday
. This is the
Christian representation where SUNDAY
is the first day of the week represented with 1. The enum constants
of Weekday
are ordered such that MONDAY
comes first, so you can use Enum.ordinal()
for other
representation. Please note that Enum.ordinal()
is 0
based so you might want to increment the result.public Weekday add(int days)
Weekday
resulting if the given number of days
are elapsed after the current
Weekday
(this). The Weekday
will wrap so add(7)
will return the Weekday
itself (this) just like add(0)
or e.g. add(-14)
.days
- are the number of days to add. May be negative to subtract or zero (0
) for no change.Weekday
.public String toString()
Datatype
String
representation of this Datatype
. While the general contract of
Object.toString()
is very weak and mainly used for debugging, the contract here is very strong. The
returned String
has to be suitable for end-users and official output to any kind of sink. NlsMessage
for
this purpose and implement NlsObject
if you want to support I18N/L10N.public static Weekday fromValue(String value)
Weekday
for the given value
.public static Weekday fromCalendar(Calendar calendar)
Weekday
from the given calendar
.public static Weekday fromCalendarId(int calendarId)
Weekday
from the given calendar
.calendarId
- is the calendar ID
.Weekday
representing the calendar ID
or null
if no such
Weekday
exists (illegal calendarId
).Copyright © 2001–2016 mmm-Team. All rights reserved.