@Test public final void testGetEtherType_ethertypeNull() { secRuleBuilder.setEthertype(null); Assert.assertNull(SecRuleEntityDecoder.getEtherType(secRuleBuilder.build())); }
public static Long getEtherType(SecurityRule secRule) { Class<? extends EthertypeBase> ethertype = secRule.getEthertype(); if (ethertype == null) { return null; } if (ethertype.isAssignableFrom(EthertypeV4.class)) { return EtherTypeClassifierDefinition.IPv4_VALUE; } if (ethertype.isAssignableFrom(EthertypeV6.class)) { return EtherTypeClassifierDefinition.IPv6_VALUE; } throw new IllegalArgumentException("Ethertype " + ethertype + " is not supported."); }
SecRuleEntityDecoder { public static Long getEtherType(SecurityRule secRule) { Class<? extends EthertypeBase> ethertype = secRule.getEthertype(); if (ethertype == null) { return null; } if (ethertype.isAssignableFrom(EthertypeV4.class)) { return EtherTypeClassifierDefinition.IPv4_VALUE; } if (ethertype.isAssignableFrom(EthertypeV6.class)) { return EtherTypeClassifierDefinition.IPv6_VALUE; } throw new IllegalArgumentException("Ethertype " + ethertype + " is not supported."); } }
SecRuleEntityDecoder { public static Long getEtherType(SecurityRule secRule) { Class<? extends EthertypeBase> ethertype = secRule.getEthertype(); if (ethertype == null) { return null; } if (ethertype.isAssignableFrom(EthertypeV4.class)) { return EtherTypeClassifierDefinition.IPv4_VALUE; } if (ethertype.isAssignableFrom(EthertypeV6.class)) { return EtherTypeClassifierDefinition.IPv6_VALUE; } throw new IllegalArgumentException("Ethertype " + ethertype + " is not supported."); } private  SecRuleEntityDecoder(); }
SecRuleEntityDecoder { public static Long getEtherType(SecurityRule secRule) { Class<? extends EthertypeBase> ethertype = secRule.getEthertype(); if (ethertype == null) { return null; } if (ethertype.isAssignableFrom(EthertypeV4.class)) { return EtherTypeClassifierDefinition.IPv4_VALUE; } if (ethertype.isAssignableFrom(EthertypeV6.class)) { return EtherTypeClassifierDefinition.IPv6_VALUE; } throw new IllegalArgumentException("Ethertype " + ethertype + " is not supported."); } private  SecRuleEntityDecoder(); static ContractId getContractId(SecurityRule secRule); static ClassifierInstance getClassifierInstance(SecurityRule secRule); static ActionRef createActionRefFromActionChoice(ActionChoice action); static ClassifierRef getClassifierRef(SecurityRule secRule); static Direction getDirection(SecurityRule secRule); static Clause getClause(SecurityRule secRule); static boolean isEtherTypeOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isProtocolOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isPortsOfOneWithinTwo(SecurityRule one, SecurityRule two); static Long getEtherType(SecurityRule secRule); static Long getProtocol(SecurityRule secRule); }
SecRuleEntityDecoder { public static Long getEtherType(SecurityRule secRule) { Class<? extends EthertypeBase> ethertype = secRule.getEthertype(); if (ethertype == null) { return null; } if (ethertype.isAssignableFrom(EthertypeV4.class)) { return EtherTypeClassifierDefinition.IPv4_VALUE; } if (ethertype.isAssignableFrom(EthertypeV6.class)) { return EtherTypeClassifierDefinition.IPv6_VALUE; } throw new IllegalArgumentException("Ethertype " + ethertype + " is not supported."); } private  SecRuleEntityDecoder(); static ContractId getContractId(SecurityRule secRule); static ClassifierInstance getClassifierInstance(SecurityRule secRule); static ActionRef createActionRefFromActionChoice(ActionChoice action); static ClassifierRef getClassifierRef(SecurityRule secRule); static Direction getDirection(SecurityRule secRule); static Clause getClause(SecurityRule secRule); static boolean isEtherTypeOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isProtocolOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isPortsOfOneWithinTwo(SecurityRule one, SecurityRule two); static Long getEtherType(SecurityRule secRule); static Long getProtocol(SecurityRule secRule);  }