All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jeasy.random.protobuf.ProtobufCustomRandomizerRegistry Maven / Gradle / Ivy

package org.jeasy.random.protobuf;

import java.lang.reflect.Field;
import java.util.function.BiPredicate;
import org.jeasy.random.api.Randomizer;
import org.jeasy.random.randomizers.registry.CustomRandomizerRegistry;

public class ProtobufCustomRandomizerRegistry extends CustomRandomizerRegistry {

    @Override
    public Randomizer getRandomizer(Field field, Object additionalData) {
        for (BiPredicate fieldPredicate : customFieldRandomizersRegistry.keySet()) {
            if (fieldPredicate.test(field, additionalData)) {
                return customFieldRandomizersRegistry.get(fieldPredicate);
            }
        }
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy