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

io.github.nichetoolkit.rest.configure.RestShaProperties Maven / Gradle / Ivy

The newest version!
package io.github.nichetoolkit.rest.configure;

import io.github.nichetoolkit.rest.util.GeneralUtils;
import io.github.nichetoolkit.rest.worker.RadixWorker;
import io.github.nichetoolkit.rest.worker.sha.ShaAlgorithm;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * RestShaProperties
 * 

The rest sha properties class.

* @author Cyan ([email protected]) * @see lombok.Getter * @see lombok.Setter * @see org.springframework.stereotype.Component * @see org.springframework.boot.context.properties.ConfigurationProperties * @since Jdk1.8 */ @Getter @Setter @Component @ConfigurationProperties(prefix = "nichetoolkit.rest.sha") public class RestShaProperties { /** * enabled *

The enabled field.

*/ private boolean enabled; /** * secret * {@link java.lang.String}

The secret field.

* @see java.lang.String */ private String secret; /** * algorithm * {@link io.github.nichetoolkit.rest.worker.sha.ShaAlgorithm}

The algorithm field.

* @see io.github.nichetoolkit.rest.worker.sha.ShaAlgorithm */ private ShaAlgorithm algorithm = ShaAlgorithm.SHA256; /** * RestShaProperties *

Instantiates a new rest sha properties.

*/ public RestShaProperties() { } /** * getSecret *

The get secret getter method.

* @return {@link java.lang.String}

The get secret return object is String type.

* @see java.lang.String */ public String getSecret() { if (GeneralUtils.isEmpty(this.secret)) { return secret = RadixWorker.encrypts(System.currentTimeMillis()); } return secret; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy