FlagSet.Builder


class FlagSet.Builder


A builder for FlagSet instances.

Summary

Public constructors

Creates a builder.

Public functions

FlagSet.Builder!

Adds a flag.

FlagSet.Builder!

Adds flags.

FlagSet.Builder!

Adds flags.

FlagSet.Builder!
@CanIgnoreReturnValue
addIf(flag: Int, condition: Boolean)

Adds a flag if the provided condition is true.

FlagSet!

Builds an FlagSet instance.

FlagSet.Builder!

Removes a flag.

FlagSet.Builder!

Removes flags.

FlagSet.Builder!

Removes a flag if the provided condition is true.

Public constructors

Builder

Builder()

Creates a builder.

Public functions

add

@CanIgnoreReturnValue
fun add(flag: Int): FlagSet.Builder!

Adds a flag.

Parameters
flag: Int

A flag.

Returns
FlagSet.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAll

@CanIgnoreReturnValue
fun addAll(flags: IntArray!): FlagSet.Builder!

Adds flags.

Parameters
flags: IntArray!

The flags to add.

Returns
FlagSet.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAll

@CanIgnoreReturnValue
fun addAll(flags: FlagSet!): FlagSet.Builder!

Adds flags.

Parameters
flags: FlagSet!

The set of flags to add.

Returns
FlagSet.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addIf

@CanIgnoreReturnValue
fun addIf(flag: Int, condition: Boolean): FlagSet.Builder!

Adds a flag if the provided condition is true. Does nothing otherwise.

Parameters
flag: Int

A flag.

condition: Boolean

A condition.

Returns
FlagSet.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

build

fun build(): FlagSet!

Builds an FlagSet instance.

Throws
java.lang.IllegalStateException

If this method has already been called.

remove

@CanIgnoreReturnValue
fun remove(flag: Int): FlagSet.Builder!

Removes a flag.

Parameters
flag: Int

A flag.

Returns
FlagSet.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

removeAll

@CanIgnoreReturnValue
fun removeAll(flags: IntArray!): FlagSet.Builder!

Removes flags.

Parameters
flags: IntArray!

The flags to remove.

Returns
FlagSet.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

removeIf

@CanIgnoreReturnValue
fun removeIf(flag: Int, condition: Boolean): FlagSet.Builder!

Removes a flag if the provided condition is true. Does nothing otherwise.

Parameters
flag: Int

A flag.

condition: Boolean

A condition.

Returns
FlagSet.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.