Class StringSetFromEnum

java.lang.Object
com.illumon.iris.db.tables.libs.StringSetFromEnum

public class StringSetFromEnum
extends Object
This class provides a object that converts from list of String values and their binary masks to a StringSetWrapper. (The first string corresponds to the value 1, the second to 2, the third to 4, etc.) Because of the use of values of 2, this conversion can handle bit sets. It is however limited to 31 possible enum values.
  • Field Details

  • Constructor Details

    • StringSetFromEnum

      public StringSetFromEnum​(String[] enums)
      Create a converter for the sequence of enums, where the i-th enum in the sequence is associated with the value Math.pow(2,i) (starting with index 0 and value 1).
  • Method Details

    • convert

      public StringSet convert​(int originalIndex)
      Return a string representation of the enum bit set given by the originalIndex.