001    package edu.nrao.sss.util;
002    
003    
004    /**
005     * The manner in which an object came to be in its current state.
006     * <p>
007     * <b>CVS Info:</b>
008     * <table style="margin-left:2em">
009     *   <tr><td>$Revision: 161 $</td></tr>
010     *   <tr><td>$Date: 2006-12-15 11:48:34 -0700 (Fri, 15 Dec 2006) $</td></tr>
011     *   <tr><td>$Author: btruitt $</td></tr>
012     * </table></p>
013     * 
014     * @author David M. Harland
015     * @since 2006-08-02
016     */
017    public enum AlterationStatus
018    {
019      AUTO_GENERATED_AND_UNALTERED,
020      
021      AUTO_GENERATED_THEN_ALTERED,
022      
023      MANUALLY_CREATED,
024      
025      UNKNOWN;
026      
027      /**
028       * Returns a default alteration status.
029       * @return a default alteration status.
030       */
031      public static AlterationStatus getDefault()
032      {
033        return AUTO_GENERATED_AND_UNALTERED;
034      }
035      
036      /**
037       * Returns a text representation of this enumeration constant.
038       * @return a text representation of this enumeration constant.
039       */
040      public String toString()
041      {
042        return EnumerationUtility.getSharedInstance().enumToString(this);
043      }
044      
045      /**
046       * Returns the alteration status represented by {@code text}.
047       * <p>
048       * For details about the transformation, see
049       * {@link EnumerationUtility#enumFromString(Class, String)}.</p>
050       * 
051       * @param text a text representation of an alteration status.
052       * 
053       * @return the alteration status represented by {@code text}.
054       */
055      public static AlterationStatus fromString(String text)
056      {
057        return EnumerationUtility.getSharedInstance()
058                                 .enumFromString(AlterationStatus.class, text);
059      }
060    }