Example usage for org.springframework.web.servlet.mvc.condition ProducesRequestCondition combine

List of usage examples for org.springframework.web.servlet.mvc.condition ProducesRequestCondition combine

Introduction

In this page you can find the example usage for org.springframework.web.servlet.mvc.condition ProducesRequestCondition combine.

Prototype

@Override
public ProducesRequestCondition combine(ProducesRequestCondition other) 

Source Link

Document

Returns the "other" instance if it has any expressions; returns "this" instance otherwise.

Usage

From source file:springfox.documentation.spring.data.rest.EntitySearchRequestHandler.java

@Override
public Set<? extends MediaType> produces() {
    ProducesRequestCondition producesCondition = requestMapping.getProducesCondition();
    if (searchResource.getDescription() != null) {
        MediaType type = searchResource.getDescription().getType();
        producesCondition.combine(new ProducesRequestCondition(type.toString()));
    }//from  ww  w.  j a  va 2 s. c om
    return producesCondition.getProducibleMediaTypes();
}