Class ConsumesMediaTypeQualifier<T>

java.lang.Object
io.micronaut.web.router.qualifier.ConsumesMediaTypeQualifier<T>
Type Parameters:
T - The Type
All Implemented Interfaces:
Qualifier<T>

public class ConsumesMediaTypeQualifier<T> extends Object implements Qualifier<T>
A Bean Qualifier that qualifies based on the value of the media type defined in the Consumes annotation.
Since:
1.0
Author:
Graeme Rocher
  • Constructor Details

    • ConsumesMediaTypeQualifier

      public ConsumesMediaTypeQualifier(MediaType contentType)
      Parameters:
      contentType - The content type as MediaType
  • Method Details

    • reduce

      public <BT extends BeanType<T>> Stream<BT> reduce(Class<T> beanType, Stream<BT> candidates)
      Specified by:
      reduce in interface Qualifier<T>
      Type Parameters:
      BT - The bean type subclass
      Parameters:
      beanType - The bean type
      candidates - The candidates
      Returns:
      The qualified candidate or null it cannot be qualified
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object