de.codesourcery.littlefuzz.extra.DifferentValueGenerator Maven / Gradle / Ivy
/*
* Copyright © 2024 Tobias Gierke ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.codesourcery.littlefuzz.extra;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.function.BiPredicate;
import java.util.function.Function;
import java.util.function.Supplier;
import org.apache.commons.lang3.Validate;
import de.codesourcery.littlefuzz.core.Fuzzer;
import de.codesourcery.littlefuzz.core.IPropertyValueGenerator;
/**
* Helper class that can wrap {@link IPropertyValueGenerator property value generators}
* so that they always generate a value that is not equal to the properties's current value.
*
*
* Because equality is a tricky problem and not all Java classes come with a suitable {@link Object#equals(Object)}
* method, this helper class allows you to register your own {@link #addEqualityRule(Class, BiPredicate) equality rules.}
*
* If no suitable rule is configured, the default behaviour of this class is to fall-back to
* {@link Object#equals(Object)}.
*
* @author [email protected]
*/
public class DifferentValueGenerator
{
private static final BiPredicate
© 2015 - 2025 Weber Informatics LLC | Privacy Policy