// Path: server/user-management/src/main/java/de/budgetfreak/usermanagement/domain/User.java
// @Entity(name = "BF_USER")
// public class User {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     @Column(name = "ID")
//     private Long id;
// 
//     @Column(name = "NAME")
//     private String name;
// 
//     @Column(name = "CURRENCY")
//     private String currency;
// 
//     public User() {
//     }
// 
//     public User(String name, String currency) {
//         this.name = name;
//         this.currency = currency;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public User setId(Long id) {
//         this.id = id;
//         return this;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public User setName(String name) {
//         this.name = name;
//         return this;
//     }
// 
//     public String getCurrency() {
//         return currency;
//     }
// 
//     public User setCurrency(String currency) {
//         this.currency = currency;
//         return this;
//     }
// }
// 
// Path: server/utils/web/src/main/java/de/budgetfreak/utils/web/ResourceAssembler.java
// public abstract class ResourceAssembler<E, R extends ResourceSupport> extends ResourceAssemblerSupport<E, R> {
// 
//     private List<ResourceLinks<E>> resourceLinkFactories;
// 
//     public ResourceAssembler(Class<?> controllerClass, Class<R> resourceType, List<ResourceLinks<E>> resourceLinkFactories) {
//         super(controllerClass, resourceType);
//         this.resourceLinkFactories = resourceLinkFactories;
//     }
// 
//     /**
//      * Converts the given entity to a {@link ResourceSupport} and adds all {@link Link}s via the available {@link ResourceLinks}.
//      *
//      * @param entity The entity to convert.
//      * @return The {@link ResourceSupport} representation.
//      * @see org.springframework.hateoas.ResourceAssembler#toResource(Object)
//      */
//     @Override
//     public R toResource(E entity) {
//         R resource = createResource(entity);
// 
//         Collection<Link> resourceLinks = findResourceLinks(entity);
//         resource.add(resourceLinks);
// 
//         return resource;
//     }
// 
//     protected abstract R createResource(E entity);
// 
//     /**
//      * Searches the Spring context for all {@link ResourceLinks} which can handle the class of the given entity.
//      *
//      * @param entity Entity to create the {link Link}s for.
//      * @return A list of all links for this entity.
//      */
//     private Collection<Link> findResourceLinks(E entity) {
//         List<Link> links = new ArrayList<>();
//         resourceLinkFactories.stream().filter(link -> link.accepts(entity.getClass())).forEach(link -> links.addAll(link.generateLinks(entity)));
//         return links;
//     }
// }
// 
// Path: server/utils/web/src/main/java/de/budgetfreak/utils/web/ResourceLinks.java
// public abstract class ResourceLinks<E> {
//     private Class<E> targetType;
// 
//     public ResourceLinks(Class<E> targetType) {
//         this.targetType = targetType;
//     }
// 
//     public abstract Collection<Link> generateLinks(E entity);
// 
//     public boolean accepts(Class<?> targetClass) {
//         return targetClass == targetType;
//     }
// }


import de.budgetfreak.usermanagement.domain.User;
import de.budgetfreak.utils.web.ResourceAssembler;
import de.budgetfreak.utils.web.ResourceLinks;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
package de.budgetfreak.usermanagement.web;



/**
 * Assembler for converting an {@link User} into an {@link UserResource}.
 */
@Component
public class UserResourceAssembler extends ResourceAssembler<User, UserResource> {

    @Autowired
// Path: server/user-management/src/main/java/de/budgetfreak/usermanagement/domain/User.java
// @Entity(name = "BF_USER")
// public class User {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     @Column(name = "ID")
//     private Long id;
// 
//     @Column(name = "NAME")
//     private String name;
// 
//     @Column(name = "CURRENCY")
//     private String currency;
// 
//     public User() {
//     }
// 
//     public User(String name, String currency) {
//         this.name = name;
//         this.currency = currency;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public User setId(Long id) {
//         this.id = id;
//         return this;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public User setName(String name) {
//         this.name = name;
//         return this;
//     }
// 
//     public String getCurrency() {
//         return currency;
//     }
// 
//     public User setCurrency(String currency) {
//         this.currency = currency;
//         return this;
//     }
// }
// 
// Path: server/utils/web/src/main/java/de/budgetfreak/utils/web/ResourceAssembler.java
// public abstract class ResourceAssembler<E, R extends ResourceSupport> extends ResourceAssemblerSupport<E, R> {
// 
//     private List<ResourceLinks<E>> resourceLinkFactories;
// 
//     public ResourceAssembler(Class<?> controllerClass, Class<R> resourceType, List<ResourceLinks<E>> resourceLinkFactories) {
//         super(controllerClass, resourceType);
//         this.resourceLinkFactories = resourceLinkFactories;
//     }
// 
//     /**
//      * Converts the given entity to a {@link ResourceSupport} and adds all {@link Link}s via the available {@link ResourceLinks}.
//      *
//      * @param entity The entity to convert.
//      * @return The {@link ResourceSupport} representation.
//      * @see org.springframework.hateoas.ResourceAssembler#toResource(Object)
//      */
//     @Override
//     public R toResource(E entity) {
//         R resource = createResource(entity);
// 
//         Collection<Link> resourceLinks = findResourceLinks(entity);
//         resource.add(resourceLinks);
// 
//         return resource;
//     }
// 
//     protected abstract R createResource(E entity);
// 
//     /**
//      * Searches the Spring context for all {@link ResourceLinks} which can handle the class of the given entity.
//      *
//      * @param entity Entity to create the {link Link}s for.
//      * @return A list of all links for this entity.
//      */
//     private Collection<Link> findResourceLinks(E entity) {
//         List<Link> links = new ArrayList<>();
//         resourceLinkFactories.stream().filter(link -> link.accepts(entity.getClass())).forEach(link -> links.addAll(link.generateLinks(entity)));
//         return links;
//     }
// }
// 
// Path: server/utils/web/src/main/java/de/budgetfreak/utils/web/ResourceLinks.java
// public abstract class ResourceLinks<E> {
//     private Class<E> targetType;
// 
//     public ResourceLinks(Class<E> targetType) {
//         this.targetType = targetType;
//     }
// 
//     public abstract Collection<Link> generateLinks(E entity);
// 
//     public boolean accepts(Class<?> targetClass) {
//         return targetClass == targetType;
//     }
// }


// Path: server/user-management/src/main/java/de/budgetfreak/usermanagement/web/UserResourceAssembler.java
import de.budgetfreak.usermanagement.domain.User;
import de.budgetfreak.utils.web.ResourceAssembler;
import de.budgetfreak.utils.web.ResourceLinks;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

package de.budgetfreak.usermanagement.web;



/**
 * Assembler for converting an {@link User} into an {@link UserResource}.
 */
@Component
public class UserResourceAssembler extends ResourceAssembler<User, UserResource> {

    @Autowired
    public UserResourceAssembler(List<ResourceLinks<User>> resourceLinks) {