package com.oguerreiro.resilient.domain;

import java.util.Random;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;

public class VariableTestSamples {

    private static final Random random = new Random();
    private static final AtomicLong longCount = new AtomicLong(random.nextInt() + (2 * Integer.MAX_VALUE));
    private static final AtomicInteger intCount = new AtomicInteger(random.nextInt() + (2 * Short.MAX_VALUE));

    public static Variable getVariableSample1() {
        return new Variable()
            .id(1L)
            .code("code1")
            .variableIndex(1)
            .name("name1")
            .description("description1")
            .outputFormula("outputFormula1")
            .version(1);
    }

    public static Variable getVariableSample2() {
        return new Variable()
            .id(2L)
            .code("code2")
            .variableIndex(2)
            .name("name2")
            .description("description2")
            .outputFormula("outputFormula2")
            .version(2);
    }

    public static Variable getVariableRandomSampleGenerator() {
        return new Variable()
            .id(longCount.incrementAndGet())
            .code(UUID.randomUUID().toString())
            .variableIndex(intCount.incrementAndGet())
            .name(UUID.randomUUID().toString())
            .description(UUID.randomUUID().toString())
            .outputFormula(UUID.randomUUID().toString())
            .version(intCount.incrementAndGet());
    }
}
