@ -1,5 +1,5 @@
/ *
* Copyright 2012 - 202 0 the original author or authors .
* Copyright 2012 - 202 3 the original author or authors .
*
* Licensed under the Apache License , Version 2.0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -248,6 +248,23 @@ public final class EndpointRequest {
return source . stream ( ) . filter ( Objects : : nonNull ) . map ( this : : getEndpointId ) . map ( pathMappedEndpoints : : getPath ) ;
}
private List < RequestMatcher > getDelegateMatchers ( RequestMatcherFactory requestMatcherFactory ,
RequestMatcherProvider matcherProvider , Set < String > paths ) {
return paths . stream ( ) . map ( ( path ) - > requestMatcherFactory . antPath ( matcherProvider , path , "/**" ) )
. collect ( Collectors . toList ( ) ) ;
}
@Override
public String toString ( ) {
return String . format ( "EndpointRequestMatcher includes=%s, excludes=%s, includeLinks=%s" ,
toString ( this . includes , "[*]" ) , toString ( this . excludes , "[]" ) , this . includeLinks ) ;
}
private String toString ( List < Object > endpoints , String emptyValue ) {
return ( ! endpoints . isEmpty ( ) ) ? endpoints . stream ( ) . map ( this : : getEndpointId ) . map ( Object : : toString )
. collect ( Collectors . joining ( ", " , "[" , "]" ) ) : emptyValue ;
}
private EndpointId getEndpointId ( Object source ) {
if ( source instanceof EndpointId ) {
return ( EndpointId ) source ;
@ -267,30 +284,6 @@ public final class EndpointRequest {
return EndpointId . of ( annotation . getString ( "id" ) ) ;
}
private List < RequestMatcher > getDelegateMatchers ( RequestMatcherFactory requestMatcherFactory ,
RequestMatcherProvider matcherProvider , Set < String > paths ) {
return paths . stream ( ) . map ( ( path ) - > requestMatcherFactory . antPath ( matcherProvider , path , "/**" ) )
. collect ( Collectors . toList ( ) ) ;
}
@Override
public String toString ( ) {
StringBuilder sb = new StringBuilder ( ) ;
if ( this . includes . isEmpty ( ) ) {
sb . append ( "EndpointRequest [includes='[" ) . append ( "*" ) . append ( "]'" ) ;
}
else {
sb . append ( "EndpointRequest [includes='" )
. append ( this . includes . stream ( ) . map ( this : : getEndpointId ) . collect ( Collectors . toList ( ) ) )
. append ( "'" ) ;
}
sb . append ( ", Excludes='" )
. append ( this . excludes . stream ( ) . map ( this : : getEndpointId ) . collect ( Collectors . toList ( ) ) ) . append ( "'" ) ;
sb . append ( ", IncludeLinks='" ) . append ( this . includeLinks ) . append ( "'" ) ;
sb . append ( "]" ) ;
return sb . toString ( ) ;
}
}
/ * *