Interface StringConditions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
StringConditions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:09.903Z") @Stability(Stable) public interface StringConditions extends software.amazon.jsii.JsiiSerializable
Conditions that can be applied to string attributes.

Example:

 import software.amazon.awscdk.services.lambda.*;
 Function fn;
 Topic myTopic = new Topic(this, "MyTopic");
 // Lambda should receive only message matching the following conditions on attributes:
 // color: 'red' or 'orange' or begins with 'bl'
 // size: anything but 'small' or 'medium'
 // price: between 100 and 200 or greater than 300
 // store: attribute must be present
 myTopic.addSubscription(LambdaSubscription.Builder.create(fn)
         .filterPolicy(Map.of(
                 "color", SubscriptionFilter.stringFilter(StringConditions.builder()
                         .allowlist(List.of("red", "orange"))
                         .matchPrefixes(List.of("bl"))
                         .matchSuffixes(List.of("ue"))
                         .build()),
                 "size", SubscriptionFilter.stringFilter(StringConditions.builder()
                         .denylist(List.of("small", "medium"))
                         .build()),
                 "price", SubscriptionFilter.numericFilter(NumericConditions.builder()
                         .between(BetweenCondition.builder().start(100).stop(200).build())
                         .greaterThan(300)
                         .build()),
                 "store", SubscriptionFilter.existsFilter()))
         .build());
 
  • Method Details

    • getAllowlist

      @Stability(Stable) @Nullable default List<String> getAllowlist()
      Match one or more values.

      Default: - None

    • getDenylist

      @Stability(Stable) @Nullable default List<String> getDenylist()
      Match any value that doesn't include any of the specified values.

      Default: - None

    • getMatchPrefixes

      @Stability(Stable) @Nullable default List<String> getMatchPrefixes()
      Matches values that begins with the specified prefixes.

      Default: - None

    • getMatchSuffixes

      @Stability(Stable) @Nullable default List<String> getMatchSuffixes()
      Matches values that end with the specified suffixes.

      Default: - None

    • builder

      @Stability(Stable) static StringConditions.Builder builder()
      Returns:
      a StringConditions.Builder of StringConditions