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

net.dongliu.dbutils.mapping.BeanMapping Maven / Gradle / Ivy

package net.dongliu.dbutils.mapping;

import net.dongliu.dbutils.internal.reflect.BeanProperty;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Map;

/**
 * Bean mapping info
 *
 * @author Liu Dong
 */
public class BeanMapping {
    private final Map propertyMap;
    private final Class cls;

    public BeanMapping(Class cls, Map propertyMap) {
        this.propertyMap = propertyMap;
        this.cls = cls;
    }

    /**
     * Get column names this bean can mapping
     */
    @Nonnull
    public Collection columnNames() {
        return propertyMap.keySet();
    }

    /**
     * Get property by name
     */
    @Nullable
    public BeanProperty getProperty(String name) {
        return propertyMap.get(name);
    }

    /**
     * Return all bean properties
     */
    @Nonnull
    public Collection> Properties() {
        return propertyMap.entrySet();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy