Separate commonly used DepositionTypeCheck into methods
Closes gh-34573 Signed-off-by: ChanHyeongLee <cksgud410@gmail.com> [brian.clozel@broadcom.com: apply code conventions] Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
This commit is contained in:
committed by
Brian Clozel
parent
de75b6e1a2
commit
8ee09e5766
@@ -99,7 +99,7 @@ public final class ContentDisposition {
|
||||
* @since 5.3
|
||||
*/
|
||||
public boolean isAttachment() {
|
||||
return (this.type != null && this.type.equalsIgnoreCase("attachment"));
|
||||
return isDispositionType("attachment");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ public final class ContentDisposition {
|
||||
* @since 5.3
|
||||
*/
|
||||
public boolean isFormData() {
|
||||
return (this.type != null && this.type.equalsIgnoreCase("form-data"));
|
||||
return isDispositionType("form-data");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,7 +115,11 @@ public final class ContentDisposition {
|
||||
* @since 5.3
|
||||
*/
|
||||
public boolean isInline() {
|
||||
return (this.type != null && this.type.equalsIgnoreCase("inline"));
|
||||
return isDispositionType("inline");
|
||||
}
|
||||
|
||||
private boolean isDispositionType(String type) {
|
||||
return this.type != null && this.type.equalsIgnoreCase(type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -556,6 +560,7 @@ public final class ContentDisposition {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A mutable builder for {@code ContentDisposition}.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user