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

com.contentgrid.spring.data.rest.mapping.jackson.JacksonBasedContainer Maven / Gradle / Ivy

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));
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy