net.anotheria.anosite.gen.shared.data.ExperimentDistributionUtils Maven / Gradle / Ivy
/**
********************************************************************************
*** ExperimentDistributionUtils.java ***
*** generated by AnoSiteGenerator (ASG), Version: 3.2.2 ***
*** Copyright (C) 2005 - 2023 Anotheria.net, www.anotheria.net ***
*** All Rights Reserved. ***
********************************************************************************
*** Don't edit this code, if you aren't sure ***
*** that you do exactly know what you are doing! ***
*** It's better to invest time in the generator, as into the generated code. ***
********************************************************************************
*/
package net.anotheria.anosite.gen.shared.data;
import java.util.Arrays;
import java.util.List;
public class ExperimentDistributionUtils implements IExperimentDistributionDefinition{
public static List getExperimentDistributionList(){
return Arrays.asList(EXPERIMENTDISTRIBUTION_NAMES);
}
public static String getName(int value){
switch(value){
case ODDEVEN:
return ODDEVEN_NAME;
case THIRD:
return THIRD_NAME;
case QUARTER:
return QUARTER_NAME;
case CUSTOM:
return CUSTOM_NAME;
default:
return "Unknown: "+value;
}
}
public static int getValue(String name){
if( ODDEVEN_NAME.equals(name))
return ODDEVEN;
if( THIRD_NAME.equals(name))
return THIRD;
if( QUARTER_NAME.equals(name))
return QUARTER;
if( CUSTOM_NAME.equals(name))
return CUSTOM;
return 0;
}
}