server/src/main/java/org/iri_research/renkan/Constants.java
author ymh <ymh.work@gmail.com>
Wed, 13 Mar 2013 15:47:08 +0100
changeset 76 523f0647513e
parent 51 3247fccfbd3f
child 80 5295e118320b
permissions -rw-r--r--
add the count of project by spaces, add pagination, update libraries and add some more unit tests.

package org.iri_research.renkan;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Constants {
	
	@SuppressWarnings("serial")
	public final static List<String> VERSION = Collections.unmodifiableList(new ArrayList<String>() {
		{
			add("0");
			add("1");
			add("0");
			add("final");
			add("0");
		}
	});
	
	
	public static String getVersion() {
		
		String[] version_array = VERSION.toArray(new String[VERSION.size()]);
		
	    String version = String.format("%s.%s",version_array[0], version_array[1]);
	    if(version_array[2] != null && !version_array[2].isEmpty() &&  Integer.parseInt(version_array[2]) > 0 ) {
	    	version = String.format("%s.%s", version, version_array[2]);
	    }
	    if (version_array[3] == "alpha" && version_array[4] == "0") {
	    	version = String.format("%s pre-alpha",version);
	    }
	    else if(version_array[3] != "final") {
	        version = String.format("%s %s %s", version, version_array[3], version_array[4]);
	    }
	    return version;

	}
	
	public final static String KEYHEX = "f2338d2299ac28ef64f82956fde37337b87a2b9e8fc03e28fa0768cac37d838113c7d0fc78c60fce1e23b1b3e03ac7db4676b3189c267f26baaab10f72544441";
	public final static int SALT_LENGTH = 24;
	public final static int PAGINATION_SIZE = 10;

}