org.lognet.springboot.grpc.autoconfigure.consul.ServiceRegistrationStrategy Maven / Gradle / Ivy
The newest version!
package org.lognet.springboot.grpc.autoconfigure.consul;
import com.ecwid.consul.json.GsonFactory;
import com.ecwid.consul.v1.agent.model.NewService;
import io.grpc.Server;
import java.util.Collection;
import org.springframework.context.ApplicationContext;
public interface ServiceRegistrationStrategy {
Collection createServices(Server grpcServer, ApplicationContext applicationContext);
default T clone(T obj, Class clazz) {
return GsonFactory.getGson().fromJson(GsonFactory.getGson().toJson(obj), clazz);
}
}