edu.nrao.sss.model.proposal
Enum JustificationFileType

java.lang.Object
  extended by java.lang.Enum<JustificationFileType>
      extended by edu.nrao.sss.model.proposal.JustificationFileType
All Implemented Interfaces:
Serializable, Comparable<JustificationFileType>

public enum JustificationFileType
extends Enum<JustificationFileType>

Placeholder for time when we integrate proposal work. An enumeration of file types for justification files.

TODO Should we think about making this more general by removing the "Justification" label an putting this in a different package?

Since:
2006-03-03
Version:
1.1

Enum Constant Summary
PDF
          Represents a PDF file.
PS
          Represents a postscript file.
TXT_OCTET
          Represents a file octal codes.
TXT_PLAIN
          Represents a plain text file.
UNKNOWN
          Represents a justification file of unknown type.
 
Method Summary
static JustificationFileType fromString(String text)
          Returns the justification file type represented by text.
static JustificationFileType getDefault()
          Returns a default justification file type.
 String toString()
           
static JustificationFileType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static JustificationFileType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PS

public static final JustificationFileType PS
Represents a postscript file.

The acceptable names of this element (for use with getInstanceFromName(String)) are PS and application/postscript.


PDF

public static final JustificationFileType PDF
Represents a PDF file.

The acceptable names of this element (for use with getInstanceFromName(String)) are PDF and application/pdf.


TXT_OCTET

public static final JustificationFileType TXT_OCTET
Represents a file octal codes.

The acceptable names of this element (for use with getInstanceFromName(String)) are TXT_OCTET and application/octet-stream.


TXT_PLAIN

public static final JustificationFileType TXT_PLAIN
Represents a plain text file.

The acceptable names of this element (for use with getInstanceFromName(String)) are TXT_PLAIN and text/plain.


UNKNOWN

public static final JustificationFileType UNKNOWN
Represents a justification file of unknown type.

This element is used to implement the Null Object Pattern. In situations where a method might be tempted to return null, this element is returned instead.

Method Detail

values

public static JustificationFileType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (JustificationFileType c : JustificationFileType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static JustificationFileType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getDefault

public static JustificationFileType getDefault()
Returns a default justification file type.

Returns:
a default justification file type.

toString

public String toString()
Overrides:
toString in class Enum<JustificationFileType>

fromString

public static JustificationFileType fromString(String text)
Returns the justification file type represented by text.

For details about the transformation, see EnumerationUtility.enumFromString(Class, String).

Parameters:
text - a text representation of a justification file type.
Returns:
the justification file type represented by text.


Copyright © 2009. All Rights Reserved.