@Override public DestinationPortRange build() { return new DestinationPortRangeImpl(this); }
@Override public SourcePortRange build() { return new SourcePortRangeImpl(this); }
private SourcePortRangeImpl(SourcePortRangeBuilder base) { this._lowerPort = base.getLowerPort(); this._upperPort = base.getUpperPort(); this.augmentation = ImmutableMap.copyOf(base.augmentation); }
public SourcePortRangeBuilder(SourcePortRange base) { this._lowerPort = base.getLowerPort(); this._upperPort = base.getUpperPort(); if (base instanceof SourcePortRangeImpl) { SourcePortRangeImpl impl = (SourcePortRangeImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<SourcePortRange> casted =(AugmentationHolder<SourcePortRange>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
public DestinationPortRangeBuilder(DestinationPortRange base) { this._lowerPort = base.getLowerPort(); this._upperPort = base.getUpperPort(); if (base instanceof DestinationPortRangeImpl) { DestinationPortRangeImpl impl = (DestinationPortRangeImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<DestinationPortRange> casted =(AugmentationHolder<DestinationPortRange>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
private DestinationPortRangeImpl(DestinationPortRangeBuilder base) { this._lowerPort = base.getLowerPort(); this._upperPort = base.getUpperPort(); this.augmentation = ImmutableMap.copyOf(base.augmentation); }
private static DestinationPortRange parseDstPortRange(final AclRule rule) { return new DestinationPortRangeBuilder() .setLowerPort(new PortNumber(Short.toUnsignedInt(rule.dstportOrIcmpcodeFirst))) .setUpperPort(new PortNumber(Short.toUnsignedInt(rule.dstportOrIcmpcodeLast))).build(); }
private static SourcePortRange parseSrcPortRange(final AclRule rule) { return new SourcePortRangeBuilder() .setLowerPort(new PortNumber(Short.toUnsignedInt(rule.srcportOrIcmptypeFirst))) .setUpperPort(new PortNumber(Short.toUnsignedInt(rule.srcportOrIcmptypeLast))).build(); }
public DestinationPortRangeBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.DestinationPortRange>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.DestinationPortRange> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
public SourcePortRangeBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.SourcePortRange>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.SourcePortRange> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
public SourcePortRangeBuilder(SourcePortRange base) { this._lowerPort = base.getLowerPort(); this._upperPort = base.getUpperPort(); if (base instanceof SourcePortRangeImpl) { SourcePortRangeImpl impl = (SourcePortRangeImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.SourcePortRange> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.SourcePortRange>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
public DestinationPortRangeBuilder(DestinationPortRange base) { this._lowerPort = base.getLowerPort(); this._upperPort = base.getUpperPort(); if (base instanceof DestinationPortRangeImpl) { DestinationPortRangeImpl impl = (DestinationPortRangeImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.DestinationPortRange> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.DestinationPortRange>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
private SourcePortRangeImpl(SourcePortRangeBuilder base) { this._lowerPort = base.getLowerPort(); this._upperPort = base.getUpperPort(); switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.SourcePortRange>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.SourcePortRange>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.SourcePortRange>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.SourcePortRange>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
private DestinationPortRangeImpl(DestinationPortRangeBuilder base) { this._lowerPort = base.getLowerPort(); this._upperPort = base.getUpperPort(); switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.DestinationPortRange>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.DestinationPortRange>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.DestinationPortRange>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev160708.acl.transport.header.fields.DestinationPortRange>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public DestinationPortRange build() { return new DestinationPortRangeImpl(this); }
public SourcePortRange build() { return new SourcePortRangeImpl(this); }
public DestinationPortRangeBuilder addAugmentation(Class<? extends Augmentation<DestinationPortRange>> augmentationType, Augmentation<DestinationPortRange> augmentationValue) { if (augmentationValue == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentationValue); return this; }
public SourcePortRangeBuilder addAugmentation(Class<? extends Augmentation<SourcePortRange>> augmentationType, Augmentation<SourcePortRange> augmentationValue) { if (augmentationValue == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentationValue); return this; }
static void bindSourcePortRange(@Nonnull final AclRule rule, @Nullable final SourcePortRange sourcePortRange) { // allow all ports by default: rule.srcportOrIcmptypeFirst = 0; rule.srcportOrIcmptypeLast = MAX_PORT_NUMBER; if(sourcePortRange != null) { // lower port is mandatory rule.srcportOrIcmptypeFirst = portNumber(sourcePortRange.getLowerPort()); if (sourcePortRange.getUpperPort() != null) { rule.srcportOrIcmptypeLast = portNumber(sourcePortRange.getUpperPort()); } else { // if upper port is missing, set lower port value as end of checked range: rule.srcportOrIcmptypeLast = rule.srcportOrIcmptypeFirst; } } }
static void bindDestinationPortRange(@Nonnull final AclRule rule, @Nullable final DestinationPortRange destinationPortRange) { // allow all ports by default: rule.dstportOrIcmpcodeFirst = 0; rule.dstportOrIcmpcodeLast = MAX_PORT_NUMBER; if(destinationPortRange != null) { // lower port is mandatory rule.dstportOrIcmpcodeFirst = portNumber(destinationPortRange.getLowerPort()); if (destinationPortRange.getUpperPort() != null) { rule.dstportOrIcmpcodeLast = portNumber(destinationPortRange.getUpperPort()); } else { // if upper port is missing, set lower port value as end of checked range: rule.dstportOrIcmpcodeLast = rule.dstportOrIcmpcodeFirst; } } }