📜  mono cast - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:16.727000             🧑  作者: Mango

代码示例1
@Override
public Mono authenticate(Authentication authentication) {
  return Mono.justOrEmpty(authentication)
      .filter(a -> a instanceof  BearerTokenAuthenticationToken)
      .cast(BearerTokenAuthenticationToken.class)
      .map(BearerTokenAuthenticationToken::getToken)
      .flatMap(this.jwtDecoder::decode)
      .flatMap(this.jwtAuthenticationConverter::convert)
      .cast(Authentication.class)
      .onErrorMap(JwtException.class, this::onError);
}