new CombinedMediaType.EffectiveMediaType( MediaTypes.mostSpecific(methodProducesType, writerProduces), false);
@Override @SuppressWarnings("RedundantIfStatement") public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ConsumesProducesAcceptor)) { return false; } final ConsumesProducesAcceptor that = (ConsumesProducesAcceptor) o; if (consumes != null ? !consumes.equals(that.consumes) : that.consumes != null) { return false; } if (methodRouting != null ? !methodRouting.equals(that.methodRouting) : that.methodRouting != null) { return false; } if (produces != null ? !produces.equals(that.produces) : that.produces != null) { return false; } return true; }
@Override public int compare(final ConsumesProducesAcceptor o1, final ConsumesProducesAcceptor o2) { // Make sure that annotated (@Consumes, @Produces) goes first. final ResourceMethod model1 = o1.methodRouting.method; final ResourceMethod model2 = o2.methodRouting.method; // @Consumes on method. int compared = compare(model1.getConsumedTypes(), model2.getConsumedTypes()); if (compared != 0) { return compared; } compared = compare(model1.getProducedTypes(), model2.getProducedTypes()); if (compared != 0) { return compared; } compared = MediaTypes.PARTIAL_ORDER_COMPARATOR.compare(o1.consumes.getMediaType(), o2.consumes.getMediaType()); if (compared != 0) { return compared; } return MediaTypes.PARTIAL_ORDER_COMPARATOR.compare(o1.produces.getMediaType(), o2.produces.getMediaType()); }
new CombinedMediaType.EffectiveMediaType( MediaTypes.mostSpecific(methodProducesType, writerProduces), false);
new CombinedMediaType.EffectiveMediaType( MediaTypes.mostSpecific(methodProducesType, writerProduces), false);
new CombinedMediaType.EffectiveMediaType( MediaTypes.mostSpecific(methodProducesType, writerProduces), false);
new CombinedMediaType.EffectiveMediaType( MediaTypes.mostSpecific(methodProducesType, writerProduces), false);
consumes, produces, satisfiable.produces.isDerived(), satisfiable.methodRouting);
consumes, produces, satisfiable.produces.isDerived(), satisfiable.methodRouting);
consumes, produces, satisfiable.produces.isDerived(), satisfiable.methodRouting);
consumes, produces, satisfiable.produces.isDerived(), satisfiable.methodRouting);
@Override public int compare(final ConsumesProducesAcceptor o1, final ConsumesProducesAcceptor o2) { // Make sure that annotated (@Consumes, @Produces) goes first. final ResourceMethod model1 = o1.methodRouting.method; final ResourceMethod model2 = o2.methodRouting.method; // @Consumes on method. int compared = compare(model1.getConsumedTypes(), model2.getConsumedTypes()); if (compared != 0) { return compared; } compared = compare(model1.getProducedTypes(), model2.getProducedTypes()); if (compared != 0) { return compared; } compared = MediaTypes.PARTIAL_ORDER_COMPARATOR.compare(o1.consumes.getMediaType(), o2.consumes.getMediaType()); if (compared != 0) { return compared; } return MediaTypes.PARTIAL_ORDER_COMPARATOR.compare(o1.produces.getMediaType(), o2.produces.getMediaType()); }
/** * Create combined client/server media type. * * if the two types are not compatible, {@link #NO_MATCH} is returned. * * @param clientType client-side media type. * @param serverType server-side media type. * @return combined client/server media type. */ static CombinedMediaType create(MediaType clientType, EffectiveMediaType serverType) { if (!clientType.isCompatible(serverType.getMediaType())) { return NO_MATCH; } final MediaType strippedClientType = MediaTypes.stripQualityParams(clientType); final MediaType strippedServerType = MediaTypes.stripQualityParams(serverType.getMediaType()); return new CombinedMediaType( MediaTypes.mostSpecific(strippedClientType, strippedServerType), MediaTypes.getQuality(clientType), QualitySourceMediaType.getQualitySource(serverType.getMediaType()), matchedWildcards(clientType, serverType)); }
@Override @SuppressWarnings("RedundantIfStatement") public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ConsumesProducesAcceptor)) { return false; } final ConsumesProducesAcceptor that = (ConsumesProducesAcceptor) o; if (consumes != null ? !consumes.equals(that.consumes) : that.consumes != null) { return false; } if (methodRouting != null ? !methodRouting.equals(that.methodRouting) : that.methodRouting != null) { return false; } if (produces != null ? !produces.equals(that.produces) : that.produces != null) { return false; } return true; }
/** * Create combined client/server media type. * * if the two types are not compatible, {@link #NO_MATCH} is returned. * * @param clientType client-side media type. * @param serverType server-side media type. * @return combined client/server media type. */ static CombinedMediaType create(MediaType clientType, EffectiveMediaType serverType) { if (!clientType.isCompatible(serverType.getMediaType())) { return NO_MATCH; } final MediaType strippedClientType = MediaTypes.stripQualityParams(clientType); final MediaType strippedServerType = MediaTypes.stripQualityParams(serverType.getMediaType()); return new CombinedMediaType( MediaTypes.mostSpecific(strippedClientType, strippedServerType), MediaTypes.getQuality(clientType), QualitySourceMediaType.getQualitySource(serverType.getMediaType()), matchedWildcards(clientType, serverType)); }
/** * Create combined client/server media type. * * if the two types are not compatible, {@link #NO_MATCH} is returned. * * @param clientType client-side media type. * @param serverType server-side media type. * @return combined client/server media type. */ static CombinedMediaType create(MediaType clientType, EffectiveMediaType serverType) { if (!clientType.isCompatible(serverType.getMediaType())) { return NO_MATCH; } final MediaType strippedClientType = MediaTypes.stripQualityParams(clientType); final MediaType strippedServerType = MediaTypes.stripQualityParams(serverType.getMediaType()); return new CombinedMediaType( MediaTypes.mostSpecific(strippedClientType, strippedServerType), MediaTypes.getQuality(clientType), QualitySourceMediaType.getQualitySource(serverType.getMediaType()), matchedWildcards(clientType, serverType)); }
@Override @SuppressWarnings("RedundantIfStatement") public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ConsumesProducesAcceptor)) { return false; } final ConsumesProducesAcceptor that = (ConsumesProducesAcceptor) o; if (consumes != null ? !consumes.equals(that.consumes) : that.consumes != null) { return false; } if (methodRouting != null ? !methodRouting.equals(that.methodRouting) : that.methodRouting != null) { return false; } if (produces != null ? !produces.equals(that.produces) : that.produces != null) { return false; } return true; }
@Override @SuppressWarnings("RedundantIfStatement") public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ConsumesProducesAcceptor)) { return false; } final ConsumesProducesAcceptor that = (ConsumesProducesAcceptor) o; if (consumes != null ? !consumes.equals(that.consumes) : that.consumes != null) { return false; } if (methodRouting != null ? !methodRouting.equals(that.methodRouting) : that.methodRouting != null) { return false; } if (produces != null ? !produces.equals(that.produces) : that.produces != null) { return false; } return true; }
/** * Create combined client/server media type. * * if the two types are not compatible, {@link #NO_MATCH} is returned. * * @param clientType client-side media type. * @param serverType server-side media type. * @return combined client/server media type. */ static CombinedMediaType create(MediaType clientType, EffectiveMediaType serverType) { if (!clientType.isCompatible(serverType.getMediaType())) { return NO_MATCH; } final MediaType strippedClientType = MediaTypes.stripQualityParams(clientType); final MediaType strippedServerType = MediaTypes.stripQualityParams(serverType.getMediaType()); return new CombinedMediaType( MediaTypes.mostSpecific(strippedClientType, strippedServerType), MediaTypes.getQuality(clientType), QualitySourceMediaType.getQualitySource(serverType.getMediaType()), matchedWildcards(clientType, serverType)); }
@Override @SuppressWarnings("RedundantIfStatement") public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ConsumesProducesAcceptor)) { return false; } final ConsumesProducesAcceptor that = (ConsumesProducesAcceptor) o; if (consumes != null ? !consumes.equals(that.consumes) : that.consumes != null) { return false; } if (methodRouting != null ? !methodRouting.equals(that.methodRouting) : that.methodRouting != null) { return false; } if (produces != null ? !produces.equals(that.produces) : that.produces != null) { return false; } return true; }