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

com.github.fge.grappa.debugger.model.db.MatchStatisticsMapper Maven / Gradle / Ivy

The newest version!
package com.github.fge.grappa.debugger.model.db;

import com.github.fge.grappa.debugger.model.RuleInfo;
import org.jooq.Record;
import org.jooq.RecordMapper;

public final class MatchStatisticsMapper
    implements RecordMapper
{
    private final RecordMapper ruleInfoMapper
        = new RuleInfoMapper();

    /**
     * A callback method indicating that the next record has been fetched.
     *
     * @param record The record to be mapped. This is never null.
     */
    @SuppressWarnings("AutoUnboxing")
    @Override
    public MatchStatistics map(final Record record)
    {
        final RuleInfo info = ruleInfoMapper.map(record);
        return new MatchStatistics(info,
            record.getValue("nonEmptyMatches", Integer.class),
            record.getValue("emptyMatches", Integer.class),
            record.getValue("failedMatches", Integer.class)
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy