public LocationBuilder setAccessSegment(final java.lang.Long value) { if (value != null) { checkAccessSegmentRange(value); } this._accessSegment = value; return this; }
private LocationImpl(LocationBuilder base) { this._accessSegment = base.getAccessSegment(); this._accessType = base.getAccessType(); this._nodeRef = base.getNodeRef(); this._tpRef = base.getTpRef(); 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.faas.fabric.endpoint.rev150930.endpoint.attributes.Location>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.endpoint.rev150930.endpoint.attributes.Location>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.endpoint.rev150930.endpoint.attributes.Location>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.endpoint.rev150930.endpoint.attributes.Location>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public LocationBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.endpoint.rev150930.endpoint.attributes.Location>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.endpoint.rev150930.endpoint.attributes.Location> 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 Location getPhyLocation(TopologyId fabricId, String inventoryNodeIdStr, String inventoryNodeConnectorIdStr) { LocationBuilder locBuilder = new LocationBuilder(); /* * TODO: For now inventory nodeId and node connector id are directly mapped * to topology. This is a kludge. A formal approach would involve an * inventory-to-topology lookup. */ NodeId nodeId = new NodeId(inventoryNodeIdStr); TpId tpId = new TpId(inventoryNodeConnectorIdStr); locBuilder.setNodeRef(new NodeRef(createNodePath(fabricId, nodeId))); locBuilder.setTpRef(new TpRef(createTpPath(fabricId, nodeId, tpId))); return locBuilder.build(); } }
epInputBuilder.setGateway(gwIP); epInputBuilder.setIpAddress(epIP); LocationBuilder phyLoc = new LocationBuilder(FabMgrYangDataUtil.getPhyLocation( new TopologyId("ovsdb:1"), //TODO . hardcode is really bad! nodeIDStr, connIDStr)); phyLoc.setAccessType(accType); phyLoc.setAccessSegment(accSeg); epInputBuilder.setLocation(phyLoc.build());
LocationBuilder locBuilder = new LocationBuilder(input.getLocation()); epBuilder.setEndpointUuid(epId); epBuilder.setLocation(locBuilder.build());