| Enum Constant and Description |
|---|
FEMALE
The Female sex.
|
MALE
The Male sex.
|
OTHER
A fallback for every non-binary sex.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAvatarResource()
Get the image resource associated with the sex.
|
static Sex |
getValue(java.lang.String s)
Get a sex from a string.
|
java.lang.String |
toString()
Convert a Sex to String.
|
static Sex |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Sex[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Sex MALE
public static final Sex FEMALE
public static final Sex OTHER
public static Sex[] values()
for (Sex c : Sex.values()) System.out.println(c);
public static Sex valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is null@Nullable public static Sex getValue(java.lang.String s)
s - The string.| String | Sex value |
|---|---|
| "male" | MALE |
| "female" | FEMALE |
| "other" | OTHER |
@NonNull public java.lang.String toString()
toString in class java.lang.Enum<Sex>public int getAvatarResource()