@Test(dataProvider = "parseDataProvider") public void parse(String from, String to, String expected) { Ipv4StatsAnalyzer parser = new Ipv4StatsAnalyzer(); FieldInfo info = new FieldInfo("ip", false, null); ExtendedStats stats = mockStats(AddressUtils.ipv4ToLong(from), AddressUtils.ipv4ToLong(to)); IPv4FieldMetadata meta = parser.parse(info, stats, 1); assertEquals(meta.getCidrAddress(), expected); }
@Override public IPv4FieldMetadata parse(FieldInfo info, ExtendedStats stats, int valuesPerDocument) { String cidr = AddressUtils.toCIDR(Math.round(stats.getMin()), Math.round(stats.getMax())); return new IPv4FieldMetadata(info.getFullPath(), valuesPerDocument, cidr); }
Ipv4StatsAnalyzer implements ExtendedStatsAnalyzer<IPv4FieldMetadata> { @Override public IPv4FieldMetadata parse(FieldInfo info, ExtendedStats stats, int valuesPerDocument) { String cidr = AddressUtils.toCIDR(Math.round(stats.getMin()), Math.round(stats.getMax())); return new IPv4FieldMetadata(info.getFullPath(), valuesPerDocument, cidr); } }
Ipv4StatsAnalyzer implements ExtendedStatsAnalyzer<IPv4FieldMetadata> { @Override public IPv4FieldMetadata parse(FieldInfo info, ExtendedStats stats, int valuesPerDocument) { String cidr = AddressUtils.toCIDR(Math.round(stats.getMin()), Math.round(stats.getMax())); return new IPv4FieldMetadata(info.getFullPath(), valuesPerDocument, cidr); }  }
Ipv4StatsAnalyzer implements ExtendedStatsAnalyzer<IPv4FieldMetadata> { @Override public IPv4FieldMetadata parse(FieldInfo info, ExtendedStats stats, int valuesPerDocument) { String cidr = AddressUtils.toCIDR(Math.round(stats.getMin()), Math.round(stats.getMax())); return new IPv4FieldMetadata(info.getFullPath(), valuesPerDocument, cidr); }  @Override IPv4FieldMetadata parse(FieldInfo info, ExtendedStats stats, int valuesPerDocument); }
Ipv4StatsAnalyzer implements ExtendedStatsAnalyzer<IPv4FieldMetadata> { @Override public IPv4FieldMetadata parse(FieldInfo info, ExtendedStats stats, int valuesPerDocument) { String cidr = AddressUtils.toCIDR(Math.round(stats.getMin()), Math.round(stats.getMax())); return new IPv4FieldMetadata(info.getFullPath(), valuesPerDocument, cidr); }  @Override IPv4FieldMetadata parse(FieldInfo info, ExtendedStats stats, int valuesPerDocument);  }