All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.hal.HalWrapper Maven / Gradle / Ivy

The newest version!
package io.quarkus.hal;

import java.util.Map;

import jakarta.ws.rs.core.Link;

public abstract class HalWrapper {

    private final Map links;

    public HalWrapper(Map links) {
        this.links = links;
    }

    public Map getLinks() {
        return links;
    }

    /**
     * This method is used by Rest Data Panache to programmatically add links to the Hal wrapper.
     *
     * @param links The links to add into the Hal wrapper.
     */
    @SuppressWarnings("unused")
    public void addLinks(Link... links) {
        for (Link link : links) {
            this.links.put(link.getRel(), new HalLink(link.getUri().toString(),
                    link.getTitle(),
                    link.getType()));
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy