com.github.fge.grappa.debugger.model.db.MatchStatisticsMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grappa-debugger Show documentation
Show all versions of grappa-debugger Show documentation
GUI application to debug grappa parsers
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)
);
}
}