@Test public void testSrcPortsToAclLineMatchExpr() { assertEquals( PacketHeaderConstraintsToAclLineMatchExprUtils.srcPortsToAclLineMatchExpr( IntegerSpace.of(new SubRange(10, 11))), match(HeaderSpace.builder().setSrcPorts(new SubRange(10, 11)).build())); }
@Nullable static AclLineMatchExpr srcPortsToAclLineMatchExpr(@Nullable IntegerSpace srcPorts) { return Optional.ofNullable(srcPorts) .map(IntegerSpace::getSubRanges) .map(k -> match(HeaderSpace.builder().setSrcPorts(k).build())) .orElse(null); }
PacketHeaderConstraintsToAclLineMatchExprUtils { @Nullable static AclLineMatchExpr srcPortsToAclLineMatchExpr(@Nullable IntegerSpace srcPorts) { return Optional.ofNullable(srcPorts) .map(IntegerSpace::getSubRanges) .map(k -> match(HeaderSpace.builder().setSrcPorts(k).build())) .orElse(null); } }
PacketHeaderConstraintsToAclLineMatchExprUtils { @Nullable static AclLineMatchExpr srcPortsToAclLineMatchExpr(@Nullable IntegerSpace srcPorts) { return Optional.ofNullable(srcPorts) .map(IntegerSpace::getSubRanges) .map(k -> match(HeaderSpace.builder().setSrcPorts(k).build())) .orElse(null); } private  PacketHeaderConstraintsToAclLineMatchExprUtils(); }
PacketHeaderConstraintsToAclLineMatchExprUtils { @Nullable static AclLineMatchExpr srcPortsToAclLineMatchExpr(@Nullable IntegerSpace srcPorts) { return Optional.ofNullable(srcPorts) .map(IntegerSpace::getSubRanges) .map(k -> match(HeaderSpace.builder().setSrcPorts(k).build())) .orElse(null); } private  PacketHeaderConstraintsToAclLineMatchExprUtils();  }
PacketHeaderConstraintsToAclLineMatchExprUtils { @Nullable static AclLineMatchExpr srcPortsToAclLineMatchExpr(@Nullable IntegerSpace srcPorts) { return Optional.ofNullable(srcPorts) .map(IntegerSpace::getSubRanges) .map(k -> match(HeaderSpace.builder().setSrcPorts(k).build())) .orElse(null); } private  PacketHeaderConstraintsToAclLineMatchExprUtils();   }