io.github.nichetoolkit.rest.configure.RestRadixProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest-toolkit-utils Show documentation
Show all versions of rest-toolkit-utils Show documentation
Rest toolkit utils project for Spring Boot
The newest version!
package io.github.nichetoolkit.rest.configure;
import io.github.nichetoolkit.rest.util.GeneralUtils;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* RestRadixProperties
* The rest radix 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.radix")
public class RestRadixProperties {
/**
* DEFAULT_DIGITS
* {@link java.lang.String} The constant DEFAULT_DIGITS
field.
* @see java.lang.String
*/
private static final String DEFAULT_DIGITS = "qwe8as2dzx9c7p5ik3mjufr4vyltn6bgh";
/**
* DEFAULT_SUPPLY
* The constant DEFAULT_SUPPLY
field.
*/
private static final char DEFAULT_SUPPLY = 'o';
/**
* enabled
* The enabled
field.
*/
private boolean enabled;
/**
* digits
* {@link java.lang.String} The digits
field.
* @see java.lang.String
*/
private String digits = DEFAULT_DIGITS;
/**
* supply
* {@link java.lang.String} The supply
field.
* @see java.lang.String
*/
private String supply = String.valueOf(DEFAULT_SUPPLY);
/**
* minLength
* {@link java.lang.Integer} The minLength
field.
* @see java.lang.Integer
*/
private Integer minLength = 6;
/**
* RestRadixProperties
* Instantiates a new rest radix properties.
*/
public RestRadixProperties() {
}
/**
* toSupplyChar
* The to supply char method.
* @return char The to supply char return object is char
type.
*/
public char toSupplyChar() {
if (GeneralUtils.isNotEmpty(this.supply)) {
return supply.charAt(0);
}
return DEFAULT_SUPPLY;
}
/**
* toDigitsChar
* The to digits char method.
* @return char The to digits char return object is char
type.
*/
public char[] toDigitsChar() {
if (GeneralUtils.isNotEmpty(this.digits)) {
return digits.toCharArray();
}
return DEFAULT_DIGITS.toCharArray();
}
}