Class FlagSet.Builder
- java.lang.Object
-
- com.google.android.exoplayer2.util.FlagSet.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
Creates a builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlagSet.Builder
add(int flag)
Adds a flag.FlagSet.Builder
addAll(int... flags)
Adds flags.FlagSet.Builder
addAll(FlagSet flags)
Addsflags
.FlagSet.Builder
addIf(int flag, boolean condition)
Adds a flag if the provided condition is true.FlagSet
build()
Builds anFlagSet
instance.FlagSet.Builder
remove(int flag)
Removes a flag.FlagSet.Builder
removeAll(int... flags)
Removes flags.FlagSet.Builder
removeIf(int flag, boolean condition)
Removes a flag if the provided condition is true.
-
-
-
Method Detail
-
add
public FlagSet.Builder add(int flag)
Adds a flag.- Parameters:
flag
- A flag.- Returns:
- This builder.
- Throws:
IllegalStateException
- Ifbuild()
has already been called.
-
addIf
public FlagSet.Builder addIf(int flag, boolean condition)
Adds a flag if the provided condition is true. Does nothing otherwise.- Parameters:
flag
- A flag.condition
- A condition.- Returns:
- This builder.
- Throws:
IllegalStateException
- Ifbuild()
has already been called.
-
addAll
public FlagSet.Builder addAll(int... flags)
Adds flags.- Parameters:
flags
- The flags to add.- Returns:
- This builder.
- Throws:
IllegalStateException
- Ifbuild()
has already been called.
-
addAll
public FlagSet.Builder addAll(FlagSet flags)
Addsflags
.- Parameters:
flags
- The set of flags to add.- Returns:
- This builder.
- Throws:
IllegalStateException
- Ifbuild()
has already been called.
-
remove
public FlagSet.Builder remove(int flag)
Removes a flag.- Parameters:
flag
- A flag.- Returns:
- This builder.
- Throws:
IllegalStateException
- Ifbuild()
has already been called.
-
removeIf
public FlagSet.Builder removeIf(int flag, boolean condition)
Removes a flag if the provided condition is true. Does nothing otherwise.- Parameters:
flag
- A flag.condition
- A condition.- Returns:
- This builder.
- Throws:
IllegalStateException
- Ifbuild()
has already been called.
-
removeAll
public FlagSet.Builder removeAll(int... flags)
Removes flags.- Parameters:
flags
- The flags to remove.- Returns:
- This builder.
- Throws:
IllegalStateException
- Ifbuild()
has already been called.
-
build
public FlagSet build()
Builds anFlagSet
instance.- Throws:
IllegalStateException
- If this method has already been called.
-
-