Package com.jayway.demo.library.rest.dto

Examples of com.jayway.demo.library.rest.dto.LoanDto


    if (book == null || !book.isBorrowed()) {
      return Response.status(Status.NOT_FOUND).build();
    }

    Customer customer = book.getBorrowedBy();
    return HateoasResponse.ok(new LoanDto(customer.getId(), book.getId()))
        .selfLink(LinkableIds.LOAN_DETAILS_ID, book.getId())
        .link(LinkableIds.BOOK_DETAILS_ID, Rels.BOOK, book.getId())
        .link(LinkableIds.CUSTOMER_DETAILS_ID, Rels.CUSTOMER, customer.getId())
        .selfLink(LinkableIds.LOAN_RETURN_ID, id).build();
  }
View Full Code Here


        if (book == null || !book.isBorrowed()) {
            return Response.status(Status.NOT_FOUND).build();
        }

        Customer customer = book.getBorrowedBy();
        return HateoasResponse.ok(new LoanDto(customer.getId(), book.getId()))
                .selfLink(LinkableIds.LOAN_DETAILS_ID, book.getId())
                .link(LinkableIds.BOOK_DETAILS_ID, Rels.BOOK, book.getId())
                .link(LinkableIds.CUSTOMER_DETAILS_ID, Rels.CUSTOMER, customer.getId())
                .selfLink(LinkableIds.LOAN_RETURN_ID, id).build();
    }
View Full Code Here

TOP

Related Classes of com.jayway.demo.library.rest.dto.LoanDto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.