com.contentgrid.spring.data.rest.mapping.jackson.JacksonBasedContainer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of contentgrid-spring-data-rest Show documentation
Show all versions of contentgrid-spring-data-rest Show documentation
ContentGrid module customizing Spring Data REST
The newest version!
package com.contentgrid.spring.data.rest.mapping.jackson;
import com.contentgrid.spring.data.rest.mapping.Container;
import com.contentgrid.spring.data.rest.mapping.Property;
import java.lang.annotation.Annotation;
import java.util.Optional;
import java.util.function.Consumer;
import lombok.AllArgsConstructor;
import org.springframework.data.util.TypeInformation;
@AllArgsConstructor
public class JacksonBasedContainer implements Container{
private final Container delegate;
@Override
public Optional findAnnotation(Class annotationClass) {
return delegate.findAnnotation(annotationClass);
}
@Override
public TypeInformation> getTypeInformation() {
return delegate.getTypeInformation();
}
@Override
public void doWithProperties(Consumer handler) {
delegate.doWithProperties(property -> {
handler.accept(new JacksonBasedProperty(property));
});
}
@Override
public void doWithAssociations(Consumer handler) {
delegate.doWithAssociations(property -> {
handler.accept(new JacksonBasedProperty(property));
});
}
}