@Test public void testGetValue_inferFromLocation() { PacketHeaderConstraints phc = PacketHeaderConstraints.unconstrained(); assertThat(SRC_IP_EXTRACTOR.getValue(phc, LOC), equalTo(Ip.parse("1.2.3.4"))); }
@Override public Ip getValue(PacketHeaderConstraints phc, @Nullable Location srcLocation) { String headerSrcIp = phc.getSrcIps(); return headerSrcIp != null ? _helper.inferSrcIpFromHeaderSrcIp(headerSrcIp) : srcLocation != null ? _helper.inferSrcIpFromSourceLocation(srcLocation) : DEFAULT_IP_ADDRESS; }
SrcIpExtractorDefault implements FieldExtractor<Ip> { @Override public Ip getValue(PacketHeaderConstraints phc, @Nullable Location srcLocation) { String headerSrcIp = phc.getSrcIps(); return headerSrcIp != null ? _helper.inferSrcIpFromHeaderSrcIp(headerSrcIp) : srcLocation != null ? _helper.inferSrcIpFromSourceLocation(srcLocation) : DEFAULT_IP_ADDRESS; } }
SrcIpExtractorDefault implements FieldExtractor<Ip> { @Override public Ip getValue(PacketHeaderConstraints phc, @Nullable Location srcLocation) { String headerSrcIp = phc.getSrcIps(); return headerSrcIp != null ? _helper.inferSrcIpFromHeaderSrcIp(headerSrcIp) : srcLocation != null ? _helper.inferSrcIpFromSourceLocation(srcLocation) : DEFAULT_IP_ADDRESS; } SrcIpExtractorDefault(IpFieldExtractorContext helper); }
SrcIpExtractorDefault implements FieldExtractor<Ip> { @Override public Ip getValue(PacketHeaderConstraints phc, @Nullable Location srcLocation) { String headerSrcIp = phc.getSrcIps(); return headerSrcIp != null ? _helper.inferSrcIpFromHeaderSrcIp(headerSrcIp) : srcLocation != null ? _helper.inferSrcIpFromSourceLocation(srcLocation) : DEFAULT_IP_ADDRESS; } SrcIpExtractorDefault(IpFieldExtractorContext helper); @Override Ip getValue(PacketHeaderConstraints phc, @Nullable Location srcLocation); }
SrcIpExtractorDefault implements FieldExtractor<Ip> { @Override public Ip getValue(PacketHeaderConstraints phc, @Nullable Location srcLocation) { String headerSrcIp = phc.getSrcIps(); return headerSrcIp != null ? _helper.inferSrcIpFromHeaderSrcIp(headerSrcIp) : srcLocation != null ? _helper.inferSrcIpFromSourceLocation(srcLocation) : DEFAULT_IP_ADDRESS; } SrcIpExtractorDefault(IpFieldExtractorContext helper); @Override Ip getValue(PacketHeaderConstraints phc, @Nullable Location srcLocation);  }