de.caff.util

## Class StatusFlag

- java.lang.Object
- - de.caff.util.AbstractBasicStatusFlag
  - - de.caff.util.StatusFlag

- All Implemented Interfaces:
    BitFlag

      public class StatusFlag
      extends AbstractBasicStatusFlag
      implements BitFlag

  Concrete implementation of a status flag, using int values.
  Author:
    Rammi

- - ### Field Summary

    - ### Fields inherited from class de.caff.util.AbstractBasicStatusFlag

      `DISABLED, ENABLED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StatusFlag(int p, java.lang.String basetag)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BitMask` | `clearIn(BitMask mask)` Clear this flag in the given bit mask.
    `java.lang.String` | `getDescription(BitMask mask)` Get the internationalized description of this flag depending whether it is set in the given value or not, using the default locale.
    `java.lang.String` | `getDescription(BitMask mask, java.util.Locale locale)` Get the internationalized description of this flag depending whether it is set or not.
    `java.lang.String` | `getI18nTag(BitMask mask)` Get the i18n tag of this flag depending whether it is set in the given value or not.
    `boolean` | `isSetIn(BitMask mask)` Is this flag set in the given mask?
    `BitMask` | `setIn(BitMask mask)` Set this flag in the given bit mask.
    `BitMask` | `toBitMask()` Convert this flag into a bit mask.

    - ### Methods inherited from class de.caff.util.AbstractBasicStatusFlag

      `getBaseTag, getDescription, getDescription, getI18nTag`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StatusFlag

          public StatusFlag(int p,
                            @NotNull
                            java.lang.String basetag)

      Constructor.
      Parameters:
        `p` - power of bit (0 to 31)
        `basetag` - i18n tag start. Depending on the value of the flag this will be expanded

  - ### Method Detail

    - #### getI18nTag

          public java.lang.String getI18nTag(@NotNull
                                             BitMask mask)

      Get the i18n tag of this flag depending whether it is set in the given value or not.
      Parameters:
        `mask` - bit mask value
      Returns:
        complete i18n tag

    - #### getDescription

          public java.lang.String getDescription(@NotNull
                                                 BitMask mask)

      Get the internationalized description of this flag depending whether it is set in the given value or not, using the default locale.
      Parameters:
        `mask` - bit mask value
      Returns:
        description text

    - #### getDescription

          public java.lang.String getDescription(@NotNull
                                                 BitMask mask,
                                                 java.util.Locale locale)

      Get the internationalized description of this flag depending whether it is set or not.
      Parameters:
        `mask` - bit mask value
        `locale` - locale to use
      Returns:
        description text

    - #### isSetIn

          public boolean isSetIn(@NotNull
                                 BitMask mask)

      Is this flag set in the given mask?
      Specified by:
        `isSetIn` in interface `BitFlag`
      Parameters:
        `mask` - bit mask
      Returns:
        `true`: if the flag is set
        `false`: if the flag is not set

    - #### toBitMask

          @NotNull
          public BitMask toBitMask()

      Convert this flag into a bit mask.
      Returns:
        bit mask

    - #### setIn

          @NotNull
          public BitMask setIn(@NotNull
                                        BitMask mask)

      Set this flag in the given bit mask.
      Specified by:
        `setIn` in interface `BitFlag`
      Parameters:
        `mask` - bit mask
      Returns:
        new bit mask where this flag is set

    - #### clearIn

          @NotNull
          public BitMask clearIn(@NotNull
                                          BitMask mask)

      Clear this flag in the given bit mask.
      Specified by:
        `clearIn` in interface `BitFlag`
      Parameters:
        `mask` - bit mask
      Returns:
        new bit mask where this flag is cleared