/** * Indicates whether this MIME Type is concrete, i.e. whether neither the type * nor the subtype is a wildcard character <code>*</code>. * @return whether this MIME Type is concrete */ public boolean isConcrete() { return !isWildcardType() && !isWildcardSubtype(); }
/** * Indicates whether this MIME Type is concrete, i.e. whether neither the type * nor the subtype is a wildcard character <code>*</code>. * @return whether this MIME Type is concrete */ public boolean isConcrete() { return !isWildcardType() && !isWildcardSubtype(); }
/** * Set the content-type header. * Applies to the SEND, MESSAGE, and ERROR frames. */ public void setContentType(@Nullable MimeType mimeType) { if (mimeType != null) { Assert.isTrue(!mimeType.isWildcardType(), "'Content-Type' cannot contain wildcard type '*'"); Assert.isTrue(!mimeType.isWildcardSubtype(), "'Content-Type' cannot contain wildcard subtype '*'"); set(CONTENT_TYPE, mimeType.toString()); } else { set(CONTENT_TYPE, null); } }
@Override public int compare(T mimeType1, T mimeType2) { if (mimeType1.isWildcardType() && !mimeType2.isWildcardType()) { // */* < audio/* return 1; } else if (mimeType2.isWildcardType() && !mimeType1.isWildcardType()) { // audio/* > */* return -1; } else if (!mimeType1.getType().equals(mimeType2.getType())) { // audio/basic == text/html return 0; } else { // mediaType1.getType().equals(mediaType2.getType()) if (mimeType1.isWildcardSubtype() && !mimeType2.isWildcardSubtype()) { // audio/* < audio/basic return 1; } else if (mimeType2.isWildcardSubtype() && !mimeType1.isWildcardSubtype()) { // audio/basic > audio/* return -1; } else if (!mimeType1.getSubtype().equals(mimeType2.getSubtype())) { // audio/basic == audio/wave return 0; } else { // mediaType2.getSubtype().equals(mediaType2.getSubtype()) return compareParameters(mimeType1, mimeType2); } } }
if (isWildcardSubtype() || other.isWildcardSubtype()) { int thisPlusIdx = getSubtype().lastIndexOf('+'); int otherPlusIdx = other.getSubtype().lastIndexOf('+');
return true; if (isWildcardSubtype()) {
@Override public int compare(T mimeType1, T mimeType2) { if (mimeType1.isWildcardType() && !mimeType2.isWildcardType()) { // */* < audio/* return 1; } else if (mimeType2.isWildcardType() && !mimeType1.isWildcardType()) { // audio/* > */* return -1; } else if (!mimeType1.getType().equals(mimeType2.getType())) { // audio/basic == text/html return 0; } else { // mediaType1.getType().equals(mediaType2.getType()) if (mimeType1.isWildcardSubtype() && !mimeType2.isWildcardSubtype()) { // audio/* < audio/basic return 1; } else if (mimeType2.isWildcardSubtype() && !mimeType1.isWildcardSubtype()) { // audio/basic > audio/* return -1; } else if (!mimeType1.getSubtype().equals(mimeType2.getSubtype())) { // audio/basic == audio/wave return 0; } else { // mediaType2.getSubtype().equals(mediaType2.getSubtype()) return compareParameters(mimeType1, mimeType2); } } }
if (isWildcardSubtype() || other.isWildcardSubtype()) { int thisPlusIdx = getSubtype().lastIndexOf('+'); int otherPlusIdx = other.getSubtype().lastIndexOf('+');
return true; if (isWildcardSubtype()) {
/** * Set the content-type header. * Applies to the SEND, MESSAGE, and ERROR frames. */ public void setContentType(@Nullable MimeType mimeType) { if (mimeType != null) { Assert.isTrue(!mimeType.isWildcardType(), "'Content-Type' cannot contain wildcard type '*'"); Assert.isTrue(!mimeType.isWildcardSubtype(), "'Content-Type' cannot contain wildcard subtype '*'"); set(CONTENT_TYPE, mimeType.toString()); } else { set(CONTENT_TYPE, null); } }
/** * Indicates whether this MIME Type is concrete, i.e. whether neither the type * nor the subtype is a wildcard character <code>*</code>. * @return whether this MIME Type is concrete */ public boolean isConcrete() { return !isWildcardType() && !isWildcardSubtype(); }
/** * Indicates whether this MIME Type is concrete, i.e. whether neither the type * nor the subtype is a wildcard character <code>*</code>. * @return whether this MIME Type is concrete */ public boolean isConcrete() { return !isWildcardType() && !isWildcardSubtype(); }
/** * Set the content-type header. * Applies to the SEND, MESSAGE, and ERROR frames. */ public void setContentType(@Nullable MimeType mimeType) { if (mimeType != null) { Assert.isTrue(!mimeType.isWildcardType(), "'Content-Type' cannot contain wildcard type '*'"); Assert.isTrue(!mimeType.isWildcardSubtype(), "'Content-Type' cannot contain wildcard subtype '*'"); set(CONTENT_TYPE, mimeType.toString()); } else { set(CONTENT_TYPE, null); } }
/** * Set the content-type header. * Applies to the SEND, MESSAGE, and ERROR frames. */ public void setContentType(@Nullable MimeType mimeType) { if (mimeType != null) { Assert.isTrue(!mimeType.isWildcardType(), "'Content-Type' cannot contain wildcard type '*'"); Assert.isTrue(!mimeType.isWildcardSubtype(), "'Content-Type' cannot contain wildcard subtype '*'"); set(CONTENT_TYPE, mimeType.toString()); } else { set(CONTENT_TYPE, null); } }
@Override public int compare(T mimeType1, T mimeType2) { if (mimeType1.isWildcardType() && !mimeType2.isWildcardType()) { // */* < audio/* return 1; } else if (mimeType2.isWildcardType() && !mimeType1.isWildcardType()) { // audio/* > */* return -1; } else if (!mimeType1.getType().equals(mimeType2.getType())) { // audio/basic == text/html return 0; } else { // mediaType1.getType().equals(mediaType2.getType()) if (mimeType1.isWildcardSubtype() && !mimeType2.isWildcardSubtype()) { // audio/* < audio/basic return 1; } else if (mimeType2.isWildcardSubtype() && !mimeType1.isWildcardSubtype()) { // audio/basic > audio/* return -1; } else if (!mimeType1.getSubtype().equals(mimeType2.getSubtype())) { // audio/basic == audio/wave return 0; } else { // mediaType2.getSubtype().equals(mediaType2.getSubtype()) return compareParameters(mimeType1, mimeType2); } } }
return true; if (isWildcardSubtype()) {
if (isWildcardSubtype() || other.isWildcardSubtype()) { int thisPlusIdx = getSubtype().lastIndexOf('+'); int otherPlusIdx = other.getSubtype().lastIndexOf('+');