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

tech.jhipster.lite.module.domain.properties.JHipsterPropertyDefaultValue Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
package tech.jhipster.lite.module.domain.properties;

import java.util.Optional;
import org.apache.commons.lang3.StringUtils;
import tech.jhipster.lite.shared.error.domain.Assert;

public record JHipsterPropertyDefaultValue(String defaultValue) {
  public JHipsterPropertyDefaultValue {
    Assert.notBlank("defaultValue", defaultValue);
  }

  public static Optional of(String defaultValue) {
    return Optional.ofNullable(defaultValue).filter(StringUtils::isNotBlank).map(JHipsterPropertyDefaultValue::new);
  }

  public String get() {
    return defaultValue();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy