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

com.github.leeonky.dal.extensions.MapPropertyAccessor Maven / Gradle / Ivy

package com.github.leeonky.dal.extensions;

import com.github.leeonky.dal.runtime.PropertyAccessor;

import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

class MapPropertyAccessor implements PropertyAccessor> {
    @Override
    public Object getValue(Map instance, Object property) {
        return instance.get(property);
    }

    @Override
    public Set getPropertyNames(Map instance) {
        return new LinkedHashSet<>(instance.keySet());
    }

    @Override
    public boolean isNull(Map instance) {
        return instance == null;
    }
}