package com.airlock.iam.oauth2.infrastructure.parameter;

import com.airlock.iam.oauth2.domain.model.session.OAuth2SessionId;
import jakarta.annotation.Nullable;
import jakarta.ws.rs.ext.ParamConverter;
import jakarta.ws.rs.ext.ParamConverterProvider;
import jakarta.ws.rs.ext.Provider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

@Provider
public class OAuth2SessionIdProvider implements ParamConverterProvider {
   @Nullable
   public <T> ParamConverter<T> getConverter(Class<T> rawType, Type genericType, Annotation[] annotations) {
      return rawType.equals(OAuth2SessionId.class) ? new OAuth2SessionIdConverter() : null;
   }
}
