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

dev.vality.woody.api.generator.TimestampIdGenerator Maven / Gradle / Ivy

There is a newer version: 2.0.8
Show newest version
package dev.vality.woody.api.generator;

public class TimestampIdGenerator implements IdGenerator {

    @Override
    public String generateId() {
        return Long.toString(System.currentTimeMillis());
    }

    @Override
    public String generateId(String prefix) {
        return new StringBuilder().append(prefix).append(System.currentTimeMillis()).toString();
    }

    @Override
    public String generateId(String prefix, int counter) {
        return new StringBuilder().append(prefix).append(System.currentTimeMillis()).append(':').append(counter)
                .toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy