Class SegmentCondition

java.lang.Object
com.flagsmith.flagengine.SegmentCondition

public class SegmentCondition extends Object
  • Constructor Details

    • SegmentCondition

      public SegmentCondition()
      No args constructor for use in serialization.
    • SegmentCondition

      public SegmentCondition(SegmentCondition source)
      Copy constructor.
      Parameters:
      source - the object being copied
    • SegmentCondition

      public SegmentCondition(SegmentConditions operator, String property, Object value)
      Constructor with all fields.
      Parameters:
      operator - the segment condition operator
      property - the property name
      value - the condition value
  • Method Details

    • setValue

      public void setValue(com.fasterxml.jackson.databind.JsonNode node)
      Set JsonNode value. Required for engine tests.
      Parameters:
      node - the JsonNode value.
      Throws:
      IllegalArgumentException - if value is not a String or List of Strings
    • setValue

      public void setValue(String value)
      Set String value.
      Parameters:
      value - New String value.
    • setValue

      public void setValue(List<String> value)
      Set List value.
      Parameters:
      value - New List value.
    • withOperator

      public SegmentCondition withOperator(SegmentConditions operator)
      Fluent setter for operator.
      Parameters:
      operator - the segment condition operator
      Returns:
      the SegmentCondition instance
    • withProperty

      public SegmentCondition withProperty(String property)
      Fluent setter for property.
      Parameters:
      property - the property name
      Returns:
      the SegmentCondition instance
    • withValue

      public SegmentCondition withValue(Object value)
      Fluent setter for value.
      Parameters:
      value - the condition value
      Returns:
      the SegmentCondition instance
    • withValue

      public SegmentCondition withValue(String value)
      Fluent setter for String value.
      Parameters:
      value - the String condition value
      Returns:
      the SegmentCondition instance
    • withValue

      public SegmentCondition withValue(List<String> value)
      Fluent setter for List value.
      Parameters:
      value - the List condition value
      Returns:
      the SegmentCondition instance
      Throws:
      IllegalArgumentException - if operator is not IN