/* * [Licence.java] * * Summary: Wordings for the various licences. * * Copyright: (c) 1998-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.9 2007-04-12 tidy with code inspector, move the anchor to details. */ package com.mindprod.prices; import com.mindprod.fastcat.FastCat; import static java.lang.System.*; /** * Wordings for the various licences. * * @author Roedy Green, Canadian Mind Products * @version 1.9 2007-04-12 tidy with code inspector, move the anchor to details. * @since 1998 */ @SuppressWarnings( { "UnusedDeclaration" } ) public enum Licence { // >>>>>no HTML<<<<<, used to generate TXT files too. FREE( "free", new FastCat( 3 ).append( "Full source included.\n" ) .append( "You may even include the source code, modified or unmodified\n" ) .append( "in free/commercial open source/proprietary programs that you write and distribute." ) .toString() ), SHAREWARE( "shareware", new FastCat( 7 ).append( "Licenses use by a single person, including use on a single server.\n" ) .append( "The evaluation version is identical to the registered version.\n" ) .append( "Full source is included even in the evaluation version.\n" ) .append( "There is no separate registered version.\n" ) .append( "PLEASE TRY BEFORE YOU BUY!\n" ) .append( "Please thoroughly test the program to be sure it is completely\n" ) .append( "satisfactory for your needs before you buy." ) .toString() ), SITE( "site licence", "Gives you the right to use the source code anywhere at your site." ), DISTRIBUTION( "unlimited redistribution license", new FastCat( 9 ).append( "Gives you the right to use this source code in programs that you\n" ) .append( "write and distribute without further royalty payment.\n" ) .append( "Free for a single person, single site or single server.\n" ) .append( "The evaluation version is identical to the registered version.\n" ) .append( "Full source is included even in the evaluation version.\n" ) .append( "There is no separate registered version.\n" ) .append( "PLEASE TRY BEFORE YOU BUY!\n" ) .append( "Please thoroughly test the program to be sure it is completely\n" ) .append( "satisfactory for your needs before you buy." ) .toString() ), CUSTOM( "custom configuration", new FastCat( 6 ).append( "You are free to use the program as-is without payment.\n" ) .append( "However, it requires programming skill to configuration.\n" ) .append( "The fee is for my time to customise the\n" ) .append( "program for you and help you install it.\n" ) .append( "Check out the prerequisites carefully and\n" ) .append( "email me to discuss your needs before you buy.\n" ) .toString() ); // e.g. bulk emailer. /** * true if want to use the debug harness */ private static final boolean DEBUGGING = false; /** * long description of this licensing arrangement */ private final String longDesc; /** * short description of this licensing arrangement */ private final String shortDesc; /** * Constructor * * @param shortDesc short description for this licensing arrangement. * @param longDesc long description for this licensing arrangement. */ Licence( String shortDesc, String longDesc ) { this.shortDesc = shortDesc; this.longDesc = longDesc; } public static void main( String[] args ) { if ( DEBUGGING ) { for ( Licence l : Licence.values() ) { out.println( l.shortDesc ); out.println( l.longDesc ); out.println( l.longDesc.length() ); } } } /** * convert lower case string to equivalent canonical enum constant, like valueOf but accepts lower case or upper * case. * * @param s alias as string * * @return equivalent Licence enum constant */ public static Licence valueOfAlias( String s ) { return valueOf( s.toUpperCase() ); } /** * Get long description of this licensing arrangement * * @return long description */ @SuppressWarnings( { "WeakerAccess" } ) public String getLongDesc() { return longDesc; } /** * get short description of this licensing arrangement * * @return short description */ @SuppressWarnings( { "WeakerAccess" } ) public String getShortDesc() { return shortDesc; } }