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

tech.guyi.ipojo.module.h2.entity.IdGeneratorFactory Maven / Gradle / Ivy

The newest version!
package tech.guyi.ipojo.module.h2.entity;

import tech.guyi.ipojo.application.utils.StringUtils;

import java.util.UUID;

public class IdGeneratorFactory {

    public static IdGenerator stringIdGenerator = new IdGenerator() {
        @Override
        public String get() {
            return UUID.randomUUID().toString().replaceAll("-","");
        }
    };

    public static IdGenerator integerIdGenerator = new IdGenerator() {
        @Override
        public Integer get() {
            return Integer.parseInt(StringUtils.randomIntString(16));
        }
    };

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy