Package com.helger.commons.mime
Class MimeTypeParameter
- java.lang.Object
-
- com.helger.commons.mime.MimeTypeParameter
-
@Immutable public class MimeTypeParameter extends Object
This class represents a single MIME type parameter.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description MimeTypeParameter(String sAttribute, String sValue)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetAttribute()StringgetValue()StringgetValueQuotedIfNecessary(EMimeQuoting eQuotingAlgorithm)inthashCode()booleanisValueRequiringQuoting()StringtoString()
-
-
-
Constructor Detail
-
MimeTypeParameter
public MimeTypeParameter(@Nonnull @Nonempty String sAttribute, @Nonnull String sValue)
Constructor.- Parameters:
sAttribute- Parameter name. Must neither benullnor empty and must matchMimeTypeParser.isToken(String).sValue- The value to use. May not benull. Must not be a valid MIME token.
-
-
Method Detail
-
getAttribute
@Nonnull @Nonempty public String getAttribute()
- Returns:
- The parameter name. Neither
nullnor empty and confirmed to be a valid MIME token.
-
getValue
@Nonnull public String getValue()
- Returns:
- The value of the parameter. Never
null. No quoting or escaping is applied to this value!
-
isValueRequiringQuoting
public boolean isValueRequiringQuoting()
- Returns:
trueif the value required quoting/escaping. This is determined by checking, if the value is a valid MIME token in which case no quoting is necessary.
-
getValueQuotedIfNecessary
@Nonnull @Nonempty public String getValueQuotedIfNecessary(@Nonnull EMimeQuoting eQuotingAlgorithm)
- Parameters:
eQuotingAlgorithm- The quoting algorithm to be used. May not benull.- Returns:
- The value of the parameter. Neither
nullnor empty. If necessary, quoting is applied according to the passed algorithm.
-
-