2323@ Internal
2424public class DirectivesUtil {
2525
26-
27- @ Deprecated // use GraphQLAppliedDirectives eventually
28- @ DeprecatedAt ("2022-02-24" )
26+ @ Deprecated (since = "2022-02-24" ) // use GraphQLAppliedDirectives eventually
2927 public static Map <String , GraphQLDirective > nonRepeatableDirectivesByName (List <GraphQLDirective > directives ) {
3028 // filter the repeatable directives
3129 List <GraphQLDirective > singletonDirectives = directives .stream ()
@@ -34,15 +32,13 @@ public static Map<String, GraphQLDirective> nonRepeatableDirectivesByName(List<G
3432 return FpKit .getByName (singletonDirectives , GraphQLDirective ::getName );
3533 }
3634
37- @ Deprecated // use GraphQLAppliedDirectives eventually
38- @ DeprecatedAt ("2022-02-24" )
35+ @ Deprecated (since = "2022-02-24" ) // use GraphQLAppliedDirectives eventually
3936 public static Map <String , ImmutableList <GraphQLDirective >> allDirectivesByName (List <GraphQLDirective > directives ) {
4037
4138 return ImmutableMap .copyOf (FpKit .groupingBy (directives , GraphQLDirective ::getName ));
4239 }
4340
44- @ Deprecated // use GraphQLAppliedDirectives eventually
45- @ DeprecatedAt ("2022-02-24" )
41+ @ Deprecated (since = "2022-02-24" ) // use GraphQLAppliedDirectives eventually
4642 public static Optional <GraphQLArgument > directiveWithArg (List <GraphQLDirective > directives , String directiveName , String argumentName ) {
4743 GraphQLDirective directive = nonRepeatableDirectivesByName (directives ).get (directiveName );
4844 GraphQLArgument argument = null ;
@@ -52,9 +48,7 @@ public static Optional<GraphQLArgument> directiveWithArg(List<GraphQLDirective>
5248 return Optional .ofNullable (argument );
5349 }
5450
55-
56- @ Deprecated // use GraphQLAppliedDirectives eventually
57- @ DeprecatedAt ("2022-02-24" )
51+ @ Deprecated (since = "2022-02-24" ) // use GraphQLAppliedDirectives eventually
5852 public static boolean isAllNonRepeatable (List <GraphQLDirective > directives ) {
5953 if (directives == null || directives .isEmpty ()) {
6054 return false ;
@@ -67,26 +61,23 @@ public static boolean isAllNonRepeatable(List<GraphQLDirective> directives) {
6761 return true ;
6862 }
6963
70- @ Deprecated // use GraphQLAppliedDirectives eventually
71- @ DeprecatedAt ("2022-02-24" )
64+ @ Deprecated (since = "2022-02-24" ) // use GraphQLAppliedDirectives eventually
7265 public static List <GraphQLDirective > add (List <GraphQLDirective > targetList , GraphQLDirective newDirective ) {
7366 assertNotNull (targetList , () -> "directive list can't be null" );
7467 assertNotNull (newDirective , () -> "directive can't be null" );
7568 targetList .add (newDirective );
7669 return targetList ;
7770 }
7871
79- @ Deprecated // use GraphQLAppliedDirectives eventually
80- @ DeprecatedAt ("2022-02-24" )
72+ @ Deprecated (since = "2022-02-24" ) // use GraphQLAppliedDirectives eventually
8173 public static List <GraphQLDirective > addAll (List <GraphQLDirective > targetList , List <GraphQLDirective > newDirectives ) {
8274 assertNotNull (targetList , () -> "directive list can't be null" );
8375 assertNotNull (newDirectives , () -> "directive list can't be null" );
8476 targetList .addAll (newDirectives );
8577 return targetList ;
8678 }
8779
88- @ Deprecated // use GraphQLAppliedDirectives eventually
89- @ DeprecatedAt ("2022-02-24" )
80+ @ Deprecated (since = "2022-02-24" ) // use GraphQLAppliedDirectives eventually
9081 public static GraphQLDirective getFirstDirective (String name , Map <String , List <GraphQLDirective >> allDirectivesByName ) {
9182 List <GraphQLDirective > directives = allDirectivesByName .getOrDefault (name , emptyList ());
9283 if (directives .isEmpty ()) {
0 commit comments