Class TraitConfig

java.lang.Object
com.flagsmith.models.TraitConfig

public class TraitConfig
extends Object
Use TraitConfig to provide a trait value along with additional parameters.

Construct a transient trait value:

new TraitConfig("value", true);

  • Constructor Details

    • TraitConfig

      public TraitConfig​(Object value, boolean isTransient)
      Get a TraitConfig instance.
      Parameters:
      value - a trait value object
      isTransient - whether the trait is transient
  • Method Details

    • getValue

      public Object getValue()
      Get trait value.
      Returns:
      the trait value
    • getIsTransient

      public boolean getIsTransient()
      Get a boolean indicating whether the trait is transient.
      Returns:
      the boolean transiency value
    • fromObject

      public static TraitConfig fromObject​(Object object)
      Convert a user-provided object to a TraitConfig instance.
      Parameters:
      object - an object or a TraitConfig instance
      Returns:
      the TraitConfig instance