001    package hirondelle.web4j.util;
002    
003    /**
004     Collected constants of general utility.
005    
006    <P>All members of this class are immutable. 
007    
008     <P>(This is an example of 
009     <a href='http://www.javapractices.com/Topic2.cjp'>class for constants</a>.)
010    */
011    public final class Consts  {
012    
013      /** Opposite of {@link #FAILS}.  */
014      public static final boolean PASSES = true;
015      /** Opposite of {@link #PASSES}.  */
016      public static final boolean FAILS = false;
017      
018      /** Opposite of {@link #FAILURE}.  */
019      public static final boolean SUCCESS = true;
020      /** Opposite of {@link #SUCCESS}.  */
021      public static final boolean FAILURE = false;
022    
023      /** 
024       Useful for {@link String} operations, which return an index of <tt>-1</tt> when 
025       an item is not found. 
026      */
027      public static final int NOT_FOUND = -1;
028      
029      /** System property - <tt>line.separator</tt>*/
030      public static final String NEW_LINE = System.getProperty("line.separator");
031      /** System property - <tt>file.separator</tt>*/
032      public static final String FILE_SEPARATOR = System.getProperty("file.separator");
033      /** System property - <tt>path.separator</tt>*/
034      public static final String PATH_SEPARATOR = System.getProperty("path.separator");
035      
036      public static final String EMPTY_STRING = "";
037      public static final String SPACE = " ";
038      public static final String TAB = "\t";
039      public static final String SINGLE_QUOTE = "'";
040      public static final String PERIOD = ".";
041      public static final String DOUBLE_QUOTE = "\"";
042    
043      // PRIVATE //
044    
045      /**
046       The caller references the constants using <tt>Consts.EMPTY_STRING</tt>, 
047       and so on. Thus, the caller should be prevented from constructing objects of 
048       this class, by declaring this private constructor. 
049      */
050      private Consts(){
051        //this prevents even the native class from 
052        //calling this ctor as well :
053        throw new AssertionError();
054      }
055    }