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 MetadataValueTestSamples {

    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 MetadataValue getMetadataValueSample1() {
        return new MetadataValue()
            .id(1L)
            .metadataPropertyCode("metadataPropertyCode1")
            .targetDomainKey("targetDomainKey1")
            .targetDomainId(1L)
            .value("value1")
            .version(1);
    }

    public static MetadataValue getMetadataValueSample2() {
        return new MetadataValue()
            .id(2L)
            .metadataPropertyCode("metadataPropertyCode2")
            .targetDomainKey("targetDomainKey2")
            .targetDomainId(2L)
            .value("value2")
            .version(2);
    }

    public static MetadataValue getMetadataValueRandomSampleGenerator() {
        return new MetadataValue()
            .id(longCount.incrementAndGet())
            .metadataPropertyCode(UUID.randomUUID().toString())
            .targetDomainKey(UUID.randomUUID().toString())
            .targetDomainId(longCount.incrementAndGet())
            .value(UUID.randomUUID().toString())
            .version(intCount.incrementAndGet());
    }
}
