public static String getOverlappingWithGroupsTargetFilter ( final String baseFilter , final List < RolloutGroup > groups , final RolloutGroup group ) { final String groupFilter = group . getTargetFilterQuery ( ) ; // when any previous group has the same filter as the target group the // overlap is 100% if ( isTargetFilterInGroups ( groupFilter , groups ) ) { return concatAndTargetFilters ( baseFilter , groupFilter ) ; } final String previousGroupFilters = getAllGroupsTargetFilter ( groups ) ; if ( ! StringUtils . isEmpty ( previousGroupFilters ) ) { if ( ! StringUtils . isEmpty ( groupFilter ) ) { return concatAndTargetFilters ( baseFilter , groupFilter , previousGroupFilters ) ; } else { return concatAndTargetFilters ( baseFilter , previousGroupFilters ) ; } } if ( ! StringUtils . isEmpty ( groupFilter ) ) { return concatAndTargetFilters ( baseFilter , groupFilter ) ; } else { return baseFilter ; } }
Creates an RSQL Filter that matches all targets that are in the provided group and in the provided groups .