FlagSet.Builder
public final class FlagSet.Builder
A builder for FlagSet instances.
Summary
Public constructors |
|---|
Builder()Creates a builder. |
Public methods |
|
|---|---|
FlagSet.Builder |
@CanIgnoreReturnValueAdds a flag. |
FlagSet.Builder |
@CanIgnoreReturnValueAdds flags. |
FlagSet.Builder |
@CanIgnoreReturnValueAdds |
FlagSet.Builder |
@CanIgnoreReturnValueAdds a flag if the provided condition is true. |
FlagSet |
build()Builds an |
FlagSet.Builder |
@CanIgnoreReturnValueRemoves a flag. |
FlagSet.Builder |
@CanIgnoreReturnValueRemoves flags. |
FlagSet.Builder |
@CanIgnoreReturnValueRemoves a flag if the provided condition is true. |
Public constructors
Public methods
add
@CanIgnoreReturnValue
public FlagSet.Builder add(int flag)
Adds a flag.
| Parameters | |
|---|---|
int flag |
A flag. |
| Returns | |
|---|---|
FlagSet.Builder |
This builder. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
addAll
@CanIgnoreReturnValue
public FlagSet.Builder addAll(int[] flags)
Adds flags.
| Parameters | |
|---|---|
int[] flags |
The flags to add. |
| Returns | |
|---|---|
FlagSet.Builder |
This builder. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
addAll
@CanIgnoreReturnValue
public FlagSet.Builder addAll(FlagSet flags)
Adds flags.
| Parameters | |
|---|---|
FlagSet flags |
The set of flags to add. |
| Returns | |
|---|---|
FlagSet.Builder |
This builder. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
addIf
@CanIgnoreReturnValue
public FlagSet.Builder addIf(int flag, boolean condition)
Adds a flag if the provided condition is true. Does nothing otherwise.
| Parameters | |
|---|---|
int flag |
A flag. |
boolean condition |
A condition. |
| Returns | |
|---|---|
FlagSet.Builder |
This builder. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
build
public FlagSet build()
Builds an FlagSet instance.
| Throws | |
|---|---|
java.lang.IllegalStateException |
If this method has already been called. |
remove
@CanIgnoreReturnValue
public FlagSet.Builder remove(int flag)
Removes a flag.
| Parameters | |
|---|---|
int flag |
A flag. |
| Returns | |
|---|---|
FlagSet.Builder |
This builder. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
removeAll
@CanIgnoreReturnValue
public FlagSet.Builder removeAll(int[] flags)
Removes flags.
| Parameters | |
|---|---|
int[] flags |
The flags to remove. |
| Returns | |
|---|---|
FlagSet.Builder |
This builder. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |
removeIf
@CanIgnoreReturnValue
public FlagSet.Builder removeIf(int flag, boolean condition)
Removes a flag if the provided condition is true. Does nothing otherwise.
| Parameters | |
|---|---|
int flag |
A flag. |
boolean condition |
A condition. |
| Returns | |
|---|---|
FlagSet.Builder |
This builder. |
| Throws | |
|---|---|
java.lang.IllegalStateException |
If |