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

org.hothub.module.common.config.SnowFlakeConfig Maven / Gradle / Ivy

The newest version!
package org.hothub.module.common.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class SnowFlakeConfig {

    private static long machineId;
    private static long datacenterId;

    @Value("${properties.snowflake.machine-id:0}")
    public void setMachineId(long machineId) {
        SnowFlakeConfig.machineId = machineId;
    }

    @Value("${properties.snowflake.datacenter-id:0}")
    public void setDatacenterId(long datacenterId) {
        SnowFlakeConfig.datacenterId = datacenterId;
    }



    public static long getMachineId() {
        return machineId;
    }

    public static long getDatacenterId() {
        return datacenterId;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy