public ServicesInfo build() { return new ServicesInfoImpl(this); }
public static ServicesInfo buildServiceInfo(String serviceName, short serviceIndex, int servicePriority, BigInteger cookie) { List<BoundServices> boundService = new ArrayList<BoundServices>(); boundService.add(new BoundServicesBuilder().setServicePriority((short)servicePriority).setServiceName(serviceName).build()); return new ServicesInfoBuilder().setBoundServices(boundService).setKey(new ServicesInfoKey(serviceName, ServiceModeIngress.class)).build(); }
public ServicesInfoBuilder(ServicesInfo base) { if (base.getKey() == null) { this._key = new ServicesInfoKey( base.getInterfaceName(), base.getServiceMode() ); this._interfaceName = base.getInterfaceName(); this._serviceMode = base.getServiceMode(); } else { this._key = base.getKey(); this._interfaceName = _key.getInterfaceName(); this._serviceMode = _key.getServiceMode(); } this._boundServices = base.getBoundServices(); if (base instanceof ServicesInfoImpl) { ServicesInfoImpl impl = (ServicesInfoImpl) 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.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
private InstanceIdentifier buildServiceId(String interfaceName, short priority) { return InstanceIdentifier.builder(ServiceBindings.class).child(ServicesInfo.class, new ServicesInfoKey(interfaceName, ServiceModeIngress.class)) .child(BoundServices.class, new BoundServicesKey(priority)).build(); }
private ServicesInfoImpl(ServicesInfoBuilder base) { if (base.getKey() == null) { this._key = new ServicesInfoKey( base.getInterfaceName(), base.getServiceMode() ); this._interfaceName = base.getInterfaceName(); this._serviceMode = base.getServiceMode(); } else { this._key = base.getKey(); this._interfaceName = _key.getInterfaceName(); this._serviceMode = _key.getServiceMode(); } this._boundServices = base.getBoundServices(); 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.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
if (!Objects.equals(_boundServices, other.getBoundServices())) { return false; if (!Objects.equals(_interfaceName, other.getInterfaceName())) { return false; if (!Objects.equals(_key, other.getKey())) { return false; if (!Objects.equals(_serviceMode, other.getServiceMode())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
public ServicesInfoBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
public static ServicesInfo buildServiceInfo(String serviceName, short serviceIndex, int servicePriority, BigInteger cookie, List<Instruction> instructions) { List<BoundServices> boundService = new ArrayList<BoundServices>(); boundService.add(new BoundServicesBuilder().setServicePriority((short)servicePriority).setServiceName(serviceName).build()); return new ServicesInfoBuilder().setBoundServices(boundService).setKey(new ServicesInfoKey(serviceName, ServiceModeIngress.class)).build(); }
/** * Builds the service id. * * @param interfaceName the interface name * @param serviceIndex the service index * @param serviceMode the service mode * @return the instance identifier */ public static InstanceIdentifier<BoundServices> buildServiceId(String interfaceName, short serviceIndex, Class<? extends ServiceModeBase> serviceMode) { return InstanceIdentifier.builder(ServiceBindings.class) .child(ServicesInfo.class, new ServicesInfoKey(interfaceName, serviceMode)) .child(BoundServices.class, new BoundServicesKey(serviceIndex)).build(); }
public static InstanceIdentifier<BoundServices> buildServiceId(String vpnInterfaceName, short serviceIndex) { return InstanceIdentifier.builder(ServiceBindings.class) .child(ServicesInfo.class, new ServicesInfoKey(vpnInterfaceName, ServiceModeIngress.class)) .child(BoundServices.class, new BoundServicesKey(serviceIndex)).build(); }
public static InstanceIdentifier<BoundServices> buildServiceId(String vpnInterfaceName, short serviceIndex) { return InstanceIdentifier.builder(ServiceBindings.class).child(ServicesInfo.class, new ServicesInfoKey(vpnInterfaceName, ServiceModeIngress.class)) .child(BoundServices.class, new BoundServicesKey(serviceIndex)).build(); }