org.sape.carbon.services.email.util
Class MailContentTypeEnum

java.lang.Object
  |
  +--org.sape.carbon.core.util.enum.BaseEnum
        |
        +--org.sape.carbon.services.email.util.MailContentTypeEnum
All Implemented Interfaces:
Serializable

public class MailContentTypeEnum
extends BaseEnum

The class encapsulates the various Mime types.

Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.6 $($Author: dvoet $ / $Date: 2003/05/05 21:21:30 $)
Author:
Nitin Gulati, June 2002
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.sape.carbon.core.util.enum.BaseEnum
 
Field Summary
static MailContentTypeEnum HTML
          Should be used for sending html emails.
static MailContentTypeEnum PLAIN_TEXT
          Should be used for sending plain text emails.
 
Fields inherited from class org.sape.carbon.core.util.enum.BaseEnum
name, ordinal
 
Constructor Summary
private MailContentTypeEnum(String name)
          Constructs a enumeration of type MailContentTypeEnum
 
Method Summary
static MailContentTypeEnum getByName(String name)
          Looks up a MailContentTypeEnum by its string representation
static MailContentTypeEnum getByOrdinal(int ordinal)
          Looks up a MailContentTypeEnum by its ordinal representation
static Iterator iterator()
          Creates an iterator over the values of the enumerated type
(package private)  Object readResolve()
          Overrides part of serialization to return a reference to an enumeration instance that is managed by the Enumeration Subsystem.
 
Methods inherited from class org.sape.carbon.core.util.enum.BaseEnum
equals, getByName, getByOrdinal, getName, getOrdinal, hashCode, iterator, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PLAIN_TEXT

public static final MailContentTypeEnum PLAIN_TEXT
Should be used for sending plain text emails.


HTML

public static final MailContentTypeEnum HTML
Should be used for sending html emails.

Constructor Detail

MailContentTypeEnum

private MailContentTypeEnum(String name)
Constructs a enumeration of type MailContentTypeEnum

Parameters:
name - the name of the content type.
Method Detail

getByName

public static final MailContentTypeEnum getByName(String name)
Looks up a MailContentTypeEnum by its string representation

Parameters:
name - the String name of a enumeration instance
Returns:
a specific MailContentTypeEnum

getByOrdinal

public static MailContentTypeEnum getByOrdinal(int ordinal)
Looks up a MailContentTypeEnum by its ordinal representation

Parameters:
ordinal - the integer ordinal value of a specific enumeration instance
Returns:
a specific MailContentTypeEnum

iterator

public static Iterator iterator()
Creates an iterator over the values of the enumerated type

Returns:
an iterator over the values of this enumerated type

readResolve

final Object readResolve()
                  throws ObjectStreamException
Overrides part of serialization to return a reference to an enumeration instance that is managed by the Enumeration Subsystem. This will always return the SAME object instance for any single enum instance and is what allows the "==" operator to be used for comparisons.

Returns:
the object instance that should be resolved by this class
Throws:
ObjectStreamException - when there is a failure to resolve the streamed object due to a format or read io exception


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.