jooby/src/main/java/org/jooby/MediaType.java
/**
   * @param that A media type to compare to.
   * @return True, if the given media type matches the current one.
   */
@param that A media type to compare to.
@return True, if the given media type matches the current one.
@param that A media type to compare to . @return True if the given media type matches the current one .
public boolean matches(final MediaType that) {
    requireNonNull(that, "A media type is required.");
    if (this == that || this.wildcardType || that.wildcardType) {
      return true;
    }
    if (type.equals(that.type)) {
      if (subtype.equals(that.subtype) || this.wildcardSubtype || that.wildcardSubtype) {
        return true;
      }
      if (subtype.startsWith("*+")) {
        return that.subtype.endsWith(subtype.substring(2));
      }
      if (subtype.startsWith("*")) {
        return that.subtype.endsWith(subtype.substring(1));
      }
    }
    return false;
  }
public boolean matches ( final MediaType that ) { requireNonNull ( that , "A media type is required." ) ; if ( this == that || this . wildcardType || that . wildcardType ) { return true ; } if ( type . equals ( that . type ) ) { if ( subtype . equals ( that . subtype ) || this . wildcardSubtype || that . wildcardSubtype ) { return true ; } if ( subtype . startsWith ( "*+" ) ) { return that . subtype . endsWith ( subtype . substring ( 2 ) ) ; } if ( subtype . startsWith ( "*" ) ) { return that . subtype . endsWith ( subtype . substring ( 1 ) ) ; } } return false ; }
@param that A media type to compare to.
@param that A media type to compare to .
// same or */*