Skip to content
Permalink
Browse files
Added validation of value range to rhythm properties.
  • Loading branch information
mifosio-04-04-2018 committed May 24, 2017
1 parent 11f8c26 commit 4e7c4aac2bdcc19ea766447d4e9bcee6c2777228
Showing 1 changed file with 7 additions and 0 deletions.
@@ -15,8 +15,11 @@
*/
package io.mifos.rhythm.service.config;

import io.mifos.core.lang.validation.constraints.ValidIdentifier;
import org.hibernate.validator.constraints.Range;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import java.util.concurrent.TimeUnit;

@@ -25,8 +28,12 @@
*/
@Component
@ConfigurationProperties(prefix="rhythm")
@Validated
public class RhythmProperties {
@ValidIdentifier
private String user;

@Range(min=0, max=3_600_000)
private Long beatCheckRate = TimeUnit.MINUTES.toMillis(10);

public RhythmProperties() {

0 comments on commit 4e7c4aa

Please sign in to comment.