Add the self link to the entity.

@param builder assumed not <code>null</code>.
@param resolvedUri the token resolved uri. Assumed not blank.
172297
private void handleSelfLink(EntityBuilder builder, String resolvedUri) {
        if (StringUtils.isBlank(resolvedUri)) {
            return;
        }
        Link link = LinkBuilder.newInstance().setRelationship(Link.RELATIONSHIP_SELF).setHref(resolvedUri).build();
        builder.addLink(link);
    }
821715
protected final void buildResolved(ResolvedMacro c, BuilderT builder, Context context)
    {
        Component processed = c.getFormatter().process(c.getInput(), context, c.getArguments());
        buildAny(processed, builder, context);
    }
65835
@RequestMapping(value = "builds/{buildId}/links", method = RequestMethod.PUT)
    public Build createBuildLinkFromForm(@PathVariable ID buildId, @RequestBody BuildLinkForm form) {
        Build build = structureService.getBuild(buildId);
        structureService.editBuildLinks(build, form);
        return build;
    }
1308413
public static void augment(UriComponentsBuilder builder, Object instance) {
        Arrays.stream(instance.getClass().getMethods())
            .sorted(MethodNameComparator.INSTANCE)
            .forEach(processMethod(builder, instance));
    }
1205824
@Override
	public WebMvcLinkBuilder linkTo(Object invocationValue) {

		Function<String, UriComponentsBuilder> builderFactory = mapping -> UriComponentsBuilderFactory.getBuilder()
				.path(mapping);

		return WebHandler.linkTo(invocationValue, WebMvcLinkBuilder::new, (builder, invocation) -> {

			MethodParameters parameters = MethodParameters.of(invocation.getMethod());
			Iterator<Object> parameterValues = Arrays.asList(invocation.getArguments()).iterator();

			for (MethodParameter parameter : parameters.getParameters()) {

				Object parameterValue = parameterValues.next();

				uriComponentsContributors.stream() //
						.filter(it -> it.supportsParameter(parameter)) //
						.forEach(it -> it.enhance(builder, parameter, parameterValue));
			}

			return builder;

		}).apply(builderFactory);
	}
736577
@PostMapping(path = "/instances", consumes = MediaType.APPLICATION_JSON_VALUE)
    public Mono<ResponseEntity<Map<String, InstanceId>>> register(@RequestBody Registration registration,
                                                                  UriComponentsBuilder builder) {
        Registration withSource = Registration.copyOf(registration).source("http-api").build();
        LOGGER.debug("Register instance {}", withSource);
        return registry.register(withSource).map(id -> {
            URI location = builder.replacePath("/instances/{id}").buildAndExpand(id).toUri();
            return ResponseEntity.created(location).body(Collections.singletonMap("id", id));
        });
    }
938765
protected function addMethodsToBuilder(ClassBuilder $builder, callable $resolveCall)
    {
        foreach (array_unique($this->expectedInstanceMethodCalls) as $methodCall) {
            $inspector = new MethodInspector($this->className, $methodCall);
            $builder->addMethod($methodCall, $resolveCall, $inspector->signatureArgs());
        }
        return parent::addMethodsToBuilder($builder, $resolveCall);
    }
173718
public URI resolveUri(URI targetUri, URI srcOrigUri, URI srcId) {
        if(targetUri.isAbsolute()) {
            return targetUri;
        } else if(srcOrigUri==null || !srcOrigUri.isAbsolute()) {
            return targetUri;
        } else {
            return srcOrigUri.resolve(targetUri);
        }
    }
104631
public static URI resolveBase(final URI baseURI, final Stack<URI> stack) throws XIncludeFatalException
    {
        final URI computedUri = XIncProcUtils.computeBase(stack);
        final URI resolvedUri = baseURI.resolve(computedUri);
        if (0 == resolvedUri.compareTo(baseURI))
        {
            throw new XIncludeFatalException("Inclusion loop error");
        }
        return resolvedUri;
    }
1256119
public static URI resolveBase(final URI baseURI, final Iterable<URI> uris)
    {
        URI resolvedUri = baseURI;
        for (final URI uri : uris)
        {
            resolvedUri = baseURI.resolve(uri);
        }
        return resolvedUri;
    }
639932
private static String buildLink(final URI linkUri, final String relation) {
        return Link.fromUri(linkUri).rel(relation).build().toString();
    }
1290569
public RestTemplateBuilder rootUri(String rootUri) {
		return new RestTemplateBuilder(this.detectRequestFactory, rootUri,
				this.messageConverters, this.requestFactorySupplier,
				this.uriTemplateHandler, this.errorHandler, this.basicAuthentication,
				this.restTemplateCustomizers, this.requestFactoryCustomizer,
				this.interceptors);
	}
425552
private void shareLink(ShareLinkBuilder builder) {
        //Cancel any existing sharing in progress.
        if (shareLinkManager_ != null) {
            shareLinkManager_.cancelShareLinkDialog(true);
        }
        shareLinkManager_ = new ShareLinkManager();
        shareLinkManager_.shareLink(builder);
    }
272492
def build(self, builder):
        
        builder.start("LocationRef", dict(LocationOID=str(self.oid)))
        builder.end("LocationRef")
163802
public static GsonBuilder registerInstant(GsonBuilder builder)
  {
    if (builder == null) { throw new NullPointerException("builder cannot be null"); }

    builder.registerTypeAdapter(INSTANT_TYPE, new InstantConverter());

    return builder;
  }
498431
private void addEntitySelector(Map<String, String> requestParameters, StringBuilder uri) {
        if (StringUtils.hasText(requestParameters.get(RequestElements.REQ_PARAM_ENTITY_SELECTOR))) {
            uri.append("/").append(requestParameters.get(RequestElements.REQ_PARAM_ENTITY_SELECTOR));
        }
    }
740481
protected URI buildLocationUri(MODEL_ID id, boolean useTemplate) {
        if (id == null) {
            throw new NotFoundException();
        }
        UriBuilder ub = uriInfo.getAbsolutePathBuilder();
        if (useTemplate) {
            return ub.build(id);
        } else {
            return ub.path(idToString(id)).build();
        }
    }