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

nl.renarj.jasdb.rest.mappers.IndexModelMapper Maven / Gradle / Ivy

There is a newer version: 1.2.1
Show newest version
package nl.renarj.jasdb.rest.mappers;

import nl.renarj.jasdb.api.metadata.IndexDefinition;
import nl.renarj.jasdb.rest.model.IndexEntry;

/**
 * @author Renze de Vries
 *         Date: 8-6-12
 *         Time: 14:51
 */
public class IndexModelMapper {
    private IndexModelMapper() {

    }

    public static IndexEntry map(IndexDefinition definition, boolean isUnique) {
        return new IndexEntry(definition.getIndexName(), definition.getHeaderDescriptor(), definition.getValueDescriptor(), isUnique, definition.getIndexType());
    }

    public static IndexDefinition map(IndexEntry entry) {
        return new IndexDefinition(entry.getName(), entry.getKeyHeader(), entry.getValueHeader(), entry.getIndexType());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy