All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.neotys.neoload.model.validation.naming.LoadPolicyStrategy Maven / Gradle / Ivy

There is a newer version: 3.3.3
Show newest version
package com.neotys.neoload.model.validation.naming;

import static com.neotys.neoload.model.scenario.PopulationPolicy.LOAD_POLICY;
import static com.neotys.neoload.model.scenario.PopulationPolicy.CONSTANT_LOAD;
import static com.neotys.neoload.model.scenario.PopulationPolicy.RAMPUP_LOAD;
import static com.neotys.neoload.model.scenario.PopulationPolicy.PEAKS_LOAD;

import javax.validation.Path.Node;

import org.hibernate.validator.internal.engine.path.NodeImpl;

import com.neotys.neoload.model.scenario.ConstantLoadPolicy;
import com.neotys.neoload.model.scenario.PeaksLoadPolicy;
import com.neotys.neoload.model.scenario.RampupLoadPolicy;

/**
 * @deprecated As of v3, replaced by an associated class from v3 version.
 */
@Deprecated
public final class LoadPolicyStrategy implements PropertyNamingStrategy {
    @Override
    public String apply(final Node node) {
    	String name = null;
        Object value = ((NodeImpl) node).getValue();
    	if (value instanceof ConstantLoadPolicy) {
    		name = CONSTANT_LOAD;
        }
        else if (value instanceof RampupLoadPolicy) {
        	name = RAMPUP_LOAD;
        }
        else if (value instanceof PeaksLoadPolicy) {
        	name = PEAKS_LOAD;
        }
    	if (name == null) {
    		name = LOAD_POLICY;
    	}
    	return name;
    }		
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy