// Path: src/main/java/org/letustakearest/presentation/representations/HotelRepresentationAssembler.java
// public interface HotelRepresentationAssembler {
// 
//     Object from(Hotel hotel);
// 
// }
// 
// Path: src/main/java/org/letustakearest/presentation/representations/hal/HalHotelRepresentationAssembler.java
// public class HalHotelRepresentationAssembler extends BaseHalRepresentationAssembler
//         implements HotelRepresentationAssembler {
// 
//     public HalHotelRepresentationAssembler(final UriInfo uriInfo) {
//         super(uriInfo);
//     }
// 
//     @Override
//     public Object from(final Hotel hotel) {
//         return withRooms(
//                 newRepresentation(selfURI(hotel)).
//                         withProperty("city", hotel.getCity().getName()).
//                         withProperty("name", hotel.getName()),
//                 hotel);
//     }
// 
//     private Representation withRooms(final Representation representation, final Hotel hotel) {
//         return hotel.getPlaces().stream().
//                 map(this::newEmbeddedRoomRepresentation).
//                 reduce(
//                         representation,
//                         (accumulator, i) -> accumulator.withRepresentation(rel("room"), i));
//     }
// 
//     private Representation newEmbeddedRoomRepresentation(final Place place) {
//         return newRepresentation().
//                 withProperty("id", place.getId()).
//                 withProperty("type", place.getCategory()).
//                 withProperty("price", place.getPrice()).
//                 withLink(rel("book"), HotelResource.bookingURI(place, uriInfo));
//     }
// 
//     private URI selfURI(final Hotel hotel) {
//         return HotelResource.selfURI(hotel, uriInfo);
//     }
// 
// }
// 
// Path: src/main/java/org/letustakearest/presentation/representations/siren/SirenHotelRepresentationAssembler.java
// public class SirenHotelRepresentationAssembler extends BaseSirenRepresentationAssembler
//         implements HotelRepresentationAssembler {
// 
//     public SirenHotelRepresentationAssembler(final UriInfo uriInfo) {
//         super(uriInfo);
//     }
// 
//     @Override
//     public Object from(Hotel hotel) {
//         return new HotelRepresentationBuilder(hotel, uriInfo).build();
//     }
// 
// }


import org.letustakearest.presentation.representations.HotelRepresentationAssembler;
import org.letustakearest.presentation.representations.hal.HalHotelRepresentationAssembler;
import org.letustakearest.presentation.representations.siren.SirenHotelRepresentationAssembler;
import javax.enterprise.inject.Produces;
import javax.ws.rs.core.UriInfo;
package org.letustakearest.presentation.representations.cdi;



/**
 * @author volodymyr.tsukur
 */
public class HotelRepresentationAssemblerProducer
        extends BaseAssemblerProducer<HotelRepresentationAssembler> {

    @Produces
    @SelectByAcceptHeader
    public HotelRepresentationAssembler produce() {
        return doProduce();
    }

    @Override
    protected HotelRepresentationAssembler hal(final UriInfo uriInfo) {
        return new HalHotelRepresentationAssembler(uriInfo);
    }

// Path: src/main/java/org/letustakearest/presentation/representations/HotelRepresentationAssembler.java
// public interface HotelRepresentationAssembler {
// 
//     Object from(Hotel hotel);
// 
// }
// 
// Path: src/main/java/org/letustakearest/presentation/representations/hal/HalHotelRepresentationAssembler.java
// public class HalHotelRepresentationAssembler extends BaseHalRepresentationAssembler
//         implements HotelRepresentationAssembler {
// 
//     public HalHotelRepresentationAssembler(final UriInfo uriInfo) {
//         super(uriInfo);
//     }
// 
//     @Override
//     public Object from(final Hotel hotel) {
//         return withRooms(
//                 newRepresentation(selfURI(hotel)).
//                         withProperty("city", hotel.getCity().getName()).
//                         withProperty("name", hotel.getName()),
//                 hotel);
//     }
// 
//     private Representation withRooms(final Representation representation, final Hotel hotel) {
//         return hotel.getPlaces().stream().
//                 map(this::newEmbeddedRoomRepresentation).
//                 reduce(
//                         representation,
//                         (accumulator, i) -> accumulator.withRepresentation(rel("room"), i));
//     }
// 
//     private Representation newEmbeddedRoomRepresentation(final Place place) {
//         return newRepresentation().
//                 withProperty("id", place.getId()).
//                 withProperty("type", place.getCategory()).
//                 withProperty("price", place.getPrice()).
//                 withLink(rel("book"), HotelResource.bookingURI(place, uriInfo));
//     }
// 
//     private URI selfURI(final Hotel hotel) {
//         return HotelResource.selfURI(hotel, uriInfo);
//     }
// 
// }
// 
// Path: src/main/java/org/letustakearest/presentation/representations/siren/SirenHotelRepresentationAssembler.java
// public class SirenHotelRepresentationAssembler extends BaseSirenRepresentationAssembler
//         implements HotelRepresentationAssembler {
// 
//     public SirenHotelRepresentationAssembler(final UriInfo uriInfo) {
//         super(uriInfo);
//     }
// 
//     @Override
//     public Object from(Hotel hotel) {
//         return new HotelRepresentationBuilder(hotel, uriInfo).build();
//     }
// 
// }


// Path: src/main/java/org/letustakearest/presentation/representations/cdi/HotelRepresentationAssemblerProducer.java
import org.letustakearest.presentation.representations.HotelRepresentationAssembler;
import org.letustakearest.presentation.representations.hal.HalHotelRepresentationAssembler;
import org.letustakearest.presentation.representations.siren.SirenHotelRepresentationAssembler;
import javax.enterprise.inject.Produces;
import javax.ws.rs.core.UriInfo;

package org.letustakearest.presentation.representations.cdi;



/**
 * @author volodymyr.tsukur
 */
public class HotelRepresentationAssemblerProducer
        extends BaseAssemblerProducer<HotelRepresentationAssembler> {

    @Produces
    @SelectByAcceptHeader
    public HotelRepresentationAssembler produce() {
        return doProduce();
    }

    @Override
    protected HotelRepresentationAssembler hal(final UriInfo uriInfo) {
        return new HalHotelRepresentationAssembler(uriInfo);
    }

    @Override