com.upokecenter.mail.DispositionBuilder
com.upokecenter.mail.DispositionBuilder
@Deprecated public class DispositionBuilder extends Object
A mutable data type that allows a content disposition to be built.
Constructors
Methods
final String getDispositionType()
Deprecated. Gets this value's disposition type, such as "inline" or "attachment".final boolean isMultipart()
Deprecated. Irrelevant for content dispositions; will be removed in the future.final boolean isText()
Deprecated. Irrelevant for content dispositions; will be removed in the future.DispositionBuilder RemoveParameter(String name)
Deprecated. Removes a parameter from this content disposition.final void setDispositionType(String value)
Deprecated.DispositionBuilder SetDispositionType(String str)
Deprecated. Sets the disposition type, such as "inline".DispositionBuilder SetParameter(String name, String value)
Deprecated. Sets a parameter of this content disposition.ContentDisposition ToDisposition()
Deprecated. Converts this object to an immutable ContentDisposition object.String toString()
Deprecated. Converts this object to a text string.
Method Details
getDispositionType
public final String getDispositionType()
Gets this value's disposition type, such as "inline" or "attachment".
Returns:
- This value's disposition type, such as "inline" or "attachment" .
Throws:
NullPointerException
- The property is being set and the value is null.IllegalArgumentException
- The property is being set and the value is an empty string.
setDispositionType
public final void setDispositionType(String value)
isText
@Deprecated public final boolean isText()
Gets a value indicating whether this is a text media type.
Returns:
true
If this is a text media type; otherwise,false
.
isMultipart
@Deprecated public final boolean isMultipart()
Gets a value indicating whether this is a multipart media type.
Returns:
true
If this is a multipart media type; otherwise,false
.
ToDisposition
public ContentDisposition ToDisposition()
Converts this object to an immutable ContentDisposition object.
Returns:
- A MediaType object.
SetDispositionType
public DispositionBuilder SetDispositionType(String str)
Sets the disposition type, such as "inline". This method enables the pattern
of method chaining (e.g., new ...().getSet()...().getSet()...()
) unlike with
the DispositionType property in .NET or the setDispositionType method (with
small s) in Java.
Parameters:
str
- The parameterstr
is a text string.
Returns:
- This instance.
Throws:
NullPointerException
- The parameterstr
is null.IllegalArgumentException
- Str is empty.
RemoveParameter
public DispositionBuilder RemoveParameter(String name)
Removes a parameter from this content disposition. Does nothing if the parameter's name doesn't exist.
Parameters:
name
- The parameter to remove. The name is compared using a basic case-insensitive comparison. (Two strings are equal in such a comparison, if they match after converting the basic upper-case letters A to Z (U+0041 to U+005A) in both strings to basic lower-case letters.).
Returns:
- This instance.
Throws:
NullPointerException
- The parametername
is null.
SetParameter
public DispositionBuilder SetParameter(String name, String value)
Sets a parameter of this content disposition.
Parameters:
name
- Name of the parameter to set. If this name already exists (compared using a basic case-insensitive comparison), it will be overwritten. (Two strings are equal in a basic case-insensitive comparison, if they match after converting the basic upper-case letters A to Z (U+0041 to U+005A) in both strings to basic lower-case letters.).value
- Value of the parameter to set.
Returns:
- This instance.
Throws:
NullPointerException
- Eithervalue
orname
is null.IllegalArgumentException
- The parametername
is empty, or it isn't a well-formed parameter name.
toString
public String toString()
Converts this object to a text string.
Overrides:
toString
in classObject
Returns:
- A string representation of this object.