ca.gc.aafc.dina.repository.meta.AttributeMetaInfoProvider 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.repository.meta;
import ca.gc.aafc.dina.mapper.IgnoreDinaMapping;
import io.crnk.core.resource.annotations.JsonApiMetaInformation;
import io.crnk.core.resource.meta.MetaInformation;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import java.util.HashMap;
import java.util.Map;
/**
* Abstract class which can be extended by a resource to add meta information to a resource's JSON
* response through Crnk.
*/
public abstract class AttributeMetaInfoProvider {
@JsonApiMetaInformation
@IgnoreDinaMapping
@Getter
@Setter
private DinaJsonMetaInfo meta;
@Builder
public static class DinaJsonMetaInfo implements MetaInformation {
private Map warnings;
public void setWarnings(Map warnings) {
this.warnings = warnings;
}
public Map getWarnings() {
return warnings;
}
public void setWarnings(String warningKey, Object warningValue) {
if (warnings == null) {
warnings = new HashMap<>();
}
this.warnings.put(warningKey, warningValue);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy