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

org.simpleflatmapper.map.mapper.DefaultPropertyNameMatcherFactory Maven / Gradle / Ivy

Go to download

Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.

There is a newer version: 9.0.2
Show newest version
package org.simpleflatmapper.map.mapper;

import org.simpleflatmapper.map.FieldKey;
import org.simpleflatmapper.reflect.meta.DefaultPropertyNameMatcher;
import org.simpleflatmapper.reflect.meta.PropertyNameMatcher;
import org.simpleflatmapper.map.PropertyNameMatcherFactory;

public class DefaultPropertyNameMatcherFactory implements PropertyNameMatcherFactory {

    public static final DefaultPropertyNameMatcherFactory DEFAULT = new DefaultPropertyNameMatcherFactory(false, false);
    public static final DefaultPropertyNameMatcherFactory CASE_SENSITIVE = DEFAULT.caseSensitive(true);
    public static final DefaultPropertyNameMatcherFactory EXACT_MATCH = DEFAULT.exactMatch(true);
    public static final DefaultPropertyNameMatcherFactory CASE_SENSITIVE_EXACT_MATCH = CASE_SENSITIVE.exactMatch(true);

    private final boolean exactMatch;
    private final boolean caseSensitive;

    private DefaultPropertyNameMatcherFactory(boolean exactMatch, boolean caseSensitive) {
        this.exactMatch = exactMatch;
        this.caseSensitive = caseSensitive;
    }

    @Override
    public PropertyNameMatcher newInstance(FieldKey key) {
        return new DefaultPropertyNameMatcher(key.getName(), 0, exactMatch, caseSensitive);
    }

    public DefaultPropertyNameMatcherFactory exactMatch(boolean exactMatch) {
        return new DefaultPropertyNameMatcherFactory(exactMatch, caseSensitive);
    }

    public DefaultPropertyNameMatcherFactory caseSensitive(boolean caseSensitive) {
        return new DefaultPropertyNameMatcherFactory(exactMatch, caseSensitive);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy