/** * Return a String representing the value of this union. * * @return String representation of this union's value. */ public String stringValue() { if (_ipAddress != null) { return _ipAddress.stringValue(); } if (_domainName != null) { return _domainName.getValue().toString(); } throw new IllegalStateException("No value assinged"); }
/** * Return a String representing the value of this union. * * @return String representation of this union's value. */ public String stringValue() { if (_mplsLabel != null) { return _mplsLabel.stringValue(); } if (_ipAddress != null) { return _ipAddress.stringValue(); } throw new IllegalStateException("No value assinged"); }
/** * Return a String representing the value of this union. * * @return String representation of this union's value. */ public String stringValue() { if (_ipAddress != null) { return _ipAddress.stringValue(); } if (_ipPrefix != null) { return _ipPrefix.stringValue(); } if (_macAddress != null) { return _macAddress.getValue().toString(); } if (_distinguishedNameType != null) { return _distinguishedNameType.getValue().toString(); } if (_asNumber != null) { return _asNumber.getValue().toString(); } throw new IllegalStateException("No value assinged"); }
/** * Return a String representing the value of this union. * * @return String representation of this union's value. */ public String stringValue() { if (_ipAddress != null) { return _ipAddress.stringValue(); } if (_ipPrefix != null) { return _ipPrefix.stringValue(); } if (_macAddress != null) { return _macAddress.getValue().toString(); } if (_distinguishedNameType != null) { return _distinguishedNameType.getValue().toString(); } if (_asNumber != null) { return _asNumber.getValue().toString(); } throw new IllegalStateException("No value assinged"); }
@Override public void readCurrentAttributes(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier, @Nonnull MapServerBuilder mapServerBuilder, @Nonnull ReadContext readContext) throws ReadFailedException { if (!lispStateCheckService.lispEnabled(readContext)) { LOG.debug("Failed to read {}. Lisp feature must be enabled first", instanceIdentifier); return; } final Optional<OneMapServerDetailsReplyDump> dump = dumpManager.getDump(instanceIdentifier, readContext.getModificationCache()); if (dump.isPresent() && dump.get().oneMapServerDetails != null) { final IpAddress currentAddress = instanceIdentifier.firstKeyOf(MapServer.class).getIpAddress(); final OneMapServerDetails currentDetail = dump.get().oneMapServerDetails.stream() .filter(detail -> currentAddress.stringValue().equalsIgnoreCase( arrayToIpAddress(byteToBoolean(detail.isIpv6), detail.ipAddress).stringValue())) .collect(RWUtils.singleItemCollector()); mapServerBuilder .setIpAddress(arrayToIpAddress(byteToBoolean(currentDetail.isIpv6), currentDetail.ipAddress)); } } }