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

tech.guyi.web.quick.service.controller.handler.ServiceGetEntityHandler Maven / Gradle / Ivy

The newest version!
package tech.guyi.web.quick.service.controller.handler;

import org.springframework.util.StringUtils;
import tech.guyi.web.quick.core.controller.interfaces.handler.GetEntityHandler;
import tech.guyi.web.quick.service.getter.GetService;

import java.util.List;
import java.util.Optional;

public interface ServiceGetEntityHandler extends GetEntityHandler, GetService {

    @Override
    default Optional getById(ID id) {
        return this.getService().findById(id);
    }

    @Override
    default boolean existsById(ID id) {
        return !StringUtils.isEmpty(id) && this.getService().existsById(id);
    }

    @Override
    default List findAll(){
        return this.getService().findAll();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy