ca.gc.aafc.dina.config.ResourceNameIdentifierConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dina-base-api Show documentation
Show all versions of dina-base-api Show documentation
Base DINA API package for Java built on SpringBoot and Crnk
package ca.gc.aafc.dina.config;
import java.util.Map;
import java.util.Optional;
import lombok.Builder;
import lombok.Singular;
/**
* This class allows to configure the fields name for classes that may be used for
* ResourceNameIdentifier service.
*/
@Builder
public class ResourceNameIdentifierConfig {
public static final ResourceNameConfig DEFAULT_CONFIG =
new ResourceNameConfig("name", "group");
@Singular
private Map, ResourceNameConfig> configs;
/**
* Get the {@link ResourceNameConfig} for the provided class or {@link Optional#empty()}
* @param clazz
* @return @link ResourceNameConfig} for the provided class or {@link Optional#empty()}
*/
public Optional getResourceNameConfig(Class> clazz) {
return Optional.ofNullable(configs.get(clazz));
}
public record ResourceNameConfig(String nameColumn, String groupColumn) {
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy