Obfuscate with the given {@link BiMap}

@param rules
the rules
@param toObfuscate
the {@link String} object to obfuscate
@return the string
320290
public static String obfuscateWith(
		final BiMap<Character, ObfuscationRule<Character, Character>> rules,
		final String toObfuscate)
	{
		final StringBuilder sb = new StringBuilder();
		for (int i = 0; i < toObfuscate.length(); i++)
		{
			final char currentCharacter = toObfuscate.charAt(i);
			final Character asCharacter = Character.valueOf(currentCharacter);
			final String charAsString = Character.toString(currentCharacter);
			if (rules.containsKey(asCharacter))
			{
				final ObfuscationRule<Character, Character> obfuscationOperationRule = rules
					.get(asCharacter);
				final Character replaceWith = obfuscationOperationRule.getReplaceWith();
				sb.append(replaceWith);
			}
			else
			{
				sb.append(charAsString);
			}
		}
		return sb.toString();
	}
324139
public String gaRuleAccessMethodName(final AbstractRule rule) {
    String _gaRuleIdentifyer = this.gaRuleIdentifyer(rule);
    String _plus = ("get" + _gaRuleIdentifyer);
    return (_plus + "Rule");
  }
618241
public Map<String, ImplT> convertToUnmodifiableMap(List<InnerT> innerList) {
        Map<String, ImplT> result = new HashMap<>();
        for (InnerT inner : innerList) {
            result.put(name(inner), impl(inner));
        }

        return Collections.unmodifiableMap(result);
    }
149066
public static PolygonSymbolizer polygonSymbolizerFromRule( Rule rule ) {
        List<Symbolizer> symbolizers = rule.symbolizers();
        PolygonSymbolizer polygonSymbolizer = null;
        for( Symbolizer symbolizer : symbolizers ) {
            if (symbolizer instanceof PolygonSymbolizer) {
                polygonSymbolizer = (PolygonSymbolizer) symbolizer;
                break;
            }
        }
        if (polygonSymbolizer == null) {
            throw new IllegalArgumentException();
        }
        return polygonSymbolizer;
    }
732891
public static String disentangle(
		final BiMap<Character, ObfuscationOperationRule<Character, Character>> rules,
		final String obfuscated)
	{
		boolean processed = false;
		char currentChar;
		boolean upperCase;
		boolean lowerCase;
		Character currentCharacter;
		final StringBuilder sb = new StringBuilder();
		for (int i = 0; i < obfuscated.length(); i++)
		{
			processed = false;
			currentChar = obfuscated.charAt(i);
			upperCase = Character.isUpperCase(currentChar);
			lowerCase = Character.isLowerCase(currentChar);
			currentCharacter = Character.valueOf(currentChar);

			for (final Entry<Character, ObfuscationOperationRule<Character, Character>> entry : rules
				.entrySet())
			{
				ObfuscationOperationRule<Character, Character> obfuscationOperationRule = entry
					.getValue();
				Set<Integer> indexes = obfuscationOperationRule.getIndexes();
				Operation operation = obfuscationOperationRule.getOperation();
				Character character = obfuscationOperationRule.getCharacter();
				Character replaceWith = obfuscationOperationRule.getReplaceWith();
				if (!indexes.isEmpty() && indexes.contains(Integer.valueOf(i)) && operation != null)
				{
					Character operatedCharacter = Operation.operate(character, operation);
					if (currentCharacter.equals(operatedCharacter))
					{
						if ((operation.equals(Operation.UPPERCASE) && upperCase)
							|| (operation.equals(Operation.LOWERCASE) && lowerCase))
						{
							sb.append(Operation.operate(currentChar, operation, true));
						}
						else
						{
							sb.append(Operation.operate(currentChar, operation, false));

						}
						processed = true;
						continue;
					}
					if (currentCharacter.equals(replaceWith))
					{
						sb.append(character);
						processed = true;
						continue;
					}
				}
				if (currentCharacter.equals(replaceWith) && rules.containsKey(replaceWith))
				{
					sb.append(character);
					processed = true;
					continue;
				}
			}
			if (!processed && !rules.containsKey(currentCharacter))
			{
				sb.append(currentChar);
			}
		}
		return sb.toString();
	}
991003
@Override
	public <NK, NV> FMap<NK, NV> map(BiFunction<? super K, ? super V, Product2<? extends NK, ? extends NV>> f) {
		HashFMap<NK, NV> ret = new HashFMap<>(new HashMap<>(this.size()));
		for (java.util.Map.Entry<K, V> entry : entrySet()) {
			Product2<? extends NK,? extends NV> t = f.apply(entry.getKey(), entry.getValue());
			ret.put(t.get1(), t.get2());
		}
		return ret;
	}
1016782
public static PactDslJsonRootValue or(Object example, MatchingRule... rules) {
    PactDslJsonRootValue value = new PactDslJsonRootValue();
    if (example != null) {
      value.setValue(example);
    } else {
      value.setValue(JSONObject.NULL);
    }
    value.matchers.setRules("", new MatchingRuleGroup(Arrays.asList(rules), RuleLogic.OR));
    return value;
  }
42840
public static <T, U, E extends Exception> BiPredicate<T, U> sneaked(
      SneakyBiPredicate<T, U, E> biPredicate) {
    return (t, u) -> {
      @SuppressWarnings("unchecked")
      SneakyBiPredicate<T, U, RuntimeException> castedBiPredicate =
          (SneakyBiPredicate<T, U, RuntimeException>) biPredicate;
      return castedBiPredicate.test(t, u);
    };
  }
109978
public static Set<String> validateAsRuleBody(Conjunction<Pattern> pattern, Rule rule, TransactionOLTP graph){
        Set<String> errors = new HashSet<>();
        try{
            CompositeQuery body = ReasonerQueries.composite(pattern, graph);
            Set<ResolvableQuery> complementQueries = body.getComplementQueries();
            if(complementQueries.size() > 1){
                errors.add(ErrorMessage.VALIDATION_RULE_MULTIPLE_NEGATION_BLOCKS.getMessage(rule.label()));
            }
            if(!body.isPositive() && complementQueries.stream().noneMatch(ReasonerQuery::isPositive)){
                errors.add(ErrorMessage.VALIDATION_RULE_NESTED_NEGATION.getMessage(rule.label()));
            }
        } catch (GraqlQueryException e) {
            errors.add(ErrorMessage.VALIDATION_RULE_INVALID.getMessage(rule.label(), e.getMessage()));
        }
        return errors;
    }
395047
public static Multimap<Extract, WorkUnitState> getExtractsForPredicate(
      Multimap<Extract, WorkUnitState> extractToWorkUnitStateMap, Predicate<WorkUnitState> predicate) {
    Multimap<Extract, WorkUnitState> successfulExtracts = ArrayListMultimap.create();
    for (Map.Entry<Extract, Collection<WorkUnitState>> entry : extractToWorkUnitStateMap.asMap().entrySet()) {
      if (Iterables.all(entry.getValue(), predicate)) {
        successfulExtracts.putAll(entry.getKey(), entry.getValue());
      }
    }
    return successfulExtracts;
  }
485235
public Bbox applyMargins(Bbox bounds) {
		Bbox applied = (Bbox) bounds.clone();
		Coordinate c = getUpperLeftCorner();
		Double x = c.getX();
		Double y = c.getY();
		if (null != group && group instanceof MapAddon && group != this) {
			Coordinate pc = ((MapAddon) group).getUpperLeftCorner();
			x += pc.getX();
			y += pc.getY();
		}
		applied.setX(x + applied.getX());
		applied.setY(y + applied.getY());
		return applied;
	}
210168
public static <K, V> MutableMap<K, V> rejectMapOnEntry(
            Map<K, V> map,
            Predicate2<? super K, ? super V> predicate)
    {
        return MapIterate.rejectMapOnEntry(map, predicate, UnifiedMap.<K, V>newMap());
    }
1176556
public static List<ExternalGraphic> externalGraphicsFromRule( Rule rule ) {
        List<ExternalGraphic> gList = new ArrayList<ExternalGraphic>();
        List<Symbolizer> symbolizers = rule.symbolizers();
        if (symbolizers.size() != 0) {
            for( Symbolizer symbolizer : symbolizers ) {
                Graphic[] graphics = new Graphic[2];
                if (symbolizer instanceof PointSymbolizer) {
                    PointSymbolizer pointSymbolizer = (PointSymbolizer) symbolizer;
                    graphics[0] = pointSymbolizer.getGraphic();
                } else if (symbolizer instanceof LineSymbolizer) {
                    LineSymbolizer lineSymbolizer = (LineSymbolizer) symbolizer;
                    Stroke stroke = lineSymbolizer.getStroke();
                    graphics[0] = stroke.getGraphicStroke();
                } else if (symbolizer instanceof PolygonSymbolizer) {
                    PolygonSymbolizer polygonSymbolizer = (PolygonSymbolizer) symbolizer;
                    Stroke stroke = polygonSymbolizer.getStroke();
                    if (stroke != null)
                        graphics[0] = stroke.getGraphicStroke();
                    Fill fill = polygonSymbolizer.getFill();
                    if (fill != null)
                        graphics[1] = fill.getGraphicFill();
                }
                for( int i = 0; i < graphics.length; i++ ) {
                    if (graphics[i] != null) {
                        for( GraphicalSymbol gs : graphics[i].graphicalSymbols() ) {
                            if ((gs != null) && (gs instanceof ExternalGraphic)) {
                                ExternalGraphic externalGraphic = (ExternalGraphic) gs;
                                gList.add(externalGraphic);
                            }
                        }
                    }
                }
            }
            return gList;
        }
        return Collections.emptyList();
    }
505941
public static void parseBinaryAndUnaryRules(Iterable<String> unfilteredRuleLines, 
      List<CcgBinaryRule> binaryRules, List<CcgUnaryRule> unaryRules) {
    for (String line : unfilteredRuleLines) {
      // System.out.println(line);
      if (!line.startsWith("#")) {
        try {
          binaryRules.add(CcgBinaryRule.parseFrom(line));
        } catch (IllegalArgumentException e) {
          unaryRules.add(CcgUnaryRule.parseFrom(line));
        }
      }
    }
  }
1001137
public String gaRuleIdentifyer(final AbstractRule rule) {
    final String plainName = RuleNames.getRuleNames(rule).getUniqueRuleName(rule);
    return this.toJavaIdentifier(plainName, true);
  }
855388
public static <T> RuleRouter<T> of(final Iterable<Rule<T>> rules) {
    return new RuleRouter<>(ImmutableList.copyOf(rules));
  }
1232162
public JSONObject batchRules(List<JSONObject> rules) throws AlgoliaException {
    return batchRules(rules, false, false);
  }