com.jparams.object.builder.provider.MapProvider Maven / Gradle / Ivy
package com.jparams.object.builder.provider;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import com.jparams.object.builder.Context;
import com.jparams.object.builder.type.MemberType;
public class MapProvider implements Provider
{
private final Random random = new Random();
@Override
public boolean supports(final Class> clazz)
{
return clazz.isAssignableFrom(Map.class);
}
@Override
public Map, ?> provide(final Context context)
{
if (context.getPath().getMemberType().getGenerics().size() < 2)
{
context.logWarning("No generics found. Could not populate Map");
return Collections.emptyMap();
}
final Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy