public class StaticFlag extends Object
| Constructor and Description |
|---|
StaticFlag() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
anyFlag(Enum<?>... flags) |
static boolean |
anyFlag(@NotNull Object key,
Enum<?>... flags) |
static void |
delFlag(@NotNull Enum<?> flag) |
static void |
delFlag(@NotNull Object key,
@NotNull Enum<?> flag) |
static boolean |
hasFlag(@NotNull Enum<?> flag) |
static boolean |
hasFlag(@NotNull Object key,
@NotNull Enum<?> flag) |
static boolean |
hasVote(@Nullable String flag,
String... votes)
eval the votes to flag, case-insensitive matching,
the flag must be trimmed, vote does not need to be trimmed.
|
static boolean |
hasVote(@Nullable String flag,
@Nullable String votes) |
static boolean |
notFlag(@NotNull Enum<?> flag) |
static boolean |
notFlag(@NotNull Object key,
@NotNull Enum<?> flag) |
static boolean |
notVote(@Nullable String flag,
String... votes) |
static boolean |
notVote(@Nullable String flag,
@Nullable String votes) |
static void |
setFlag(@NotNull Enum<?> flag) |
static void |
setFlag(@NotNull Object key,
@NotNull Enum<?> flag) |
static int |
vote(@NotNull String flag,
@NotNull String vote)
case-insensitive matching, the flag must be trimmed, vote does not need to be trimmed.
|
public static void setFlag(@NotNull
@NotNull Enum<?> flag)
public static void delFlag(@NotNull
@NotNull Enum<?> flag)
public static boolean hasFlag(@NotNull
@NotNull Enum<?> flag)
public static boolean anyFlag(@NotNull
Enum<?>... flags)
public static boolean notFlag(@NotNull
@NotNull Enum<?> flag)
public static int vote(@NotNull
@NotNull String flag,
@NotNull
@NotNull String vote)
case-insensitive matching, the flag must be trimmed, vote does not need to be trimmed. * `!` or `-` prefix means not, `-a`, `!a` is NOT `a` * `a` votes `b` = `0` * `!a` votes `b` = `1` * `a` votes `a` = `2` * `!a` votes `a` = `-2` result true if votes > 0, false if <= 0
public static boolean hasVote(@Nullable
@Nullable String flag,
@Nullable
String... votes)
eval the votes to flag, case-insensitive matching, the flag must be trimmed, vote does not need to be trimmed. * `[a,b,c]` is `a or b or c` * null/empty means skip, no vote * `a` votes `b` = false * `!a` votes `a` = false (veto power) * `a` votes `a` = true * `!a` votes `b` = true return true if has votes, otherwise false
public static boolean hasVote(@Nullable
@Nullable String flag,
@Nullable
@Nullable String votes)
public static boolean notVote(@Nullable
@Nullable String flag,
@Nullable
@Nullable String votes)
Copyright © 2024. All rights reserved.