public enum MonthPersian extends Enum<MonthPersian>
| Enum Constant and Description |
|---|
ABAN
The singleton instance for the month of Aban with 30 days.
|
AZAR
The singleton instance for the month of Azar with 30 days.
|
BAHMAN
The singleton instance for the month of Bahman with 30 days.
|
DAY
The singleton instance for the month of Day with 30 days.
|
ESFAND
The singleton instance for the month of Esfand with 29 days, or 30 in a leap year.
|
FARVARDIN
The singleton instance for the month of Farvardin with 31 days.
|
KHORDAD
The singleton instance for the month of Khordad with 31 days.
|
MEHR
The singleton instance for the month of Mehr with 30 days.
|
MORDAD
The singleton instance for the month of Mordad with 31 days.
|
ORDIBEHESHT
The singleton instance for the month of Ordibehesht with 31 days.
|
SHAHRIVAR
The singleton instance for the month of Shahrivar with 31 days.
|
TIR
The singleton instance for the month of Tir with 31 days.
|
| Modifier and Type | Method and Description |
|---|---|
static MonthPersian |
getEnum(int value) |
String |
getStringInEnglish()
Gets the month-of-year in english string format.
|
String |
getStringInPersian()
Gets the month-of-year in persian string format.
|
int |
getValue()
Gets the month-of-year
int value. |
static MonthPersian |
of(int month)
Obtains an instance of
MonthPersian from an int value. |
static MonthPersian |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MonthPersian[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MonthPersian FARVARDIN
1.public static final MonthPersian ORDIBEHESHT
2.public static final MonthPersian KHORDAD
3.public static final MonthPersian TIR
4.public static final MonthPersian MORDAD
5.public static final MonthPersian SHAHRIVAR
6.public static final MonthPersian MEHR
7.public static final MonthPersian ABAN
8.public static final MonthPersian AZAR
9.public static final MonthPersian DAY
10.public static final MonthPersian BAHMAN
11.public static final MonthPersian ESFAND
12.public static MonthPersian[] values()
for (MonthPersian c : MonthPersian.values()) System.out.println(c);
public static MonthPersian 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 getValue()
int value.
The values are numbered following the ISO-8601 standard, from 1 (Farvardin) to 12 (Esfand).
public static MonthPersian getEnum(int value)
public String getStringInPersian()
The string are persian values
public String getStringInEnglish()
The string are english values
public static MonthPersian of(int month)
MonthPersian from an int value.
MonthPersian is an enum representing the 12 months of the year.
This factory allows the enum to be obtained from the int value.
The int value will be from 1 (Farvardin) to 12 (Ordibehesht).
month - the month-of-year to represent, from 1 (Farvardin) to 12 (Ordibehesht)java.time.DateTimeException - if the month-of-year is invalidCopyright © 2018. All rights reserved.