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

com.github.linyuzai.connection.loadbalance.sse.concept.ParamSseIdGenerator Maven / Gradle / Ivy

The newest version!
package com.github.linyuzai.connection.loadbalance.sse.concept;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

@Getter
@RequiredArgsConstructor
public class ParamSseIdGenerator implements SseIdGenerator {

    private final String name;

    @Override
    public Object generateId(Map metadata) {
        Object id = metadata.get(name);
        if (id == null) {
            throw new IllegalArgumentException("No value found for param name: " + name);
        }
        return id;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy