ezvcard.parameters
Class MediaTypeParameter
java.lang.Object
ezvcard.parameters.VCardParameter
ezvcard.parameters.TypeParameter
ezvcard.parameters.MediaTypeParameter
- Direct Known Subclasses:
- ImageTypeParameter, KeyTypeParameter, SoundTypeParameter
public class MediaTypeParameter
- extends TypeParameter
Represents a TYPE parameter that also has a media type associated with it.
The TYPE parameter value is used in 2.1 and 3.0 vCards, while the media type
value is used in 4.0 vCards.
- Author:
- Michael Angstadt
mediaType
protected final String mediaType
extension
protected final String extension
MediaTypeParameter
public MediaTypeParameter(String value,
String mediaType,
String extension)
- Parameters:
value
- the TYPE parameter value (e.g. "JPEG")mediaType
- the media type (e.g. "image/jpeg")extension
- the file extension (e.g. "jpg")
getMediaType
public String getMediaType()
- Gets the media type.
- Returns:
- the media type (e.g. "image/jpeg")
getExtension
public String getExtension()
- Gets the file extension.
- Returns:
- the file extension (e.g. "jpg")
hashCode
public int hashCode()
- Overrides:
hashCode
in class VCardParameter
equals
public boolean equals(Object obj)
- Overrides:
equals
in class VCardParameter
findByMediaType
protected static <T extends MediaTypeParameter> T findByMediaType(String mediaType,
Class<T> clazz)
- Searches the static objects of a child class for one that has a certain
media type value.
- Parameters:
mediaType
- the media type value to look forclazz
- the child class
- Returns:
- the object or null if not found
Copyright © 2012-2013. All Rights Reserved.