From 7ab7d946558864f605aff2e6ff90b45b839dc7ea Mon Sep 17 00:00:00 2001 From: Ruediger zu Dohna Date: Sat, 4 Feb 2023 08:13:52 +0100 Subject: [PATCH] #1714: simplify --- .../client/impl/typesafe/reflection/MethodInvocation.java | 6 ++---- .../client/impl/typesafe/reflection/NamedElement.java | 4 +++- .../client/impl/typesafe/reflection/ParameterInfo.java | 5 ----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/MethodInvocation.java b/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/MethodInvocation.java index b3602d0c3..0214b3529 100644 --- a/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/MethodInvocation.java +++ b/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/MethodInvocation.java @@ -62,6 +62,7 @@ public OperationType getOperationType() { return OperationType.QUERY; } + @Override public String getName() { return queryName() .orElseGet(() -> mutationName() @@ -93,6 +94,7 @@ private Optional subscriptionName() { return Optional.empty(); } + @Override public String getRawName() { String name = method.getName(); if (name.startsWith("get") && name.length() > 3 && Character.isUpperCase(name.charAt(3))) @@ -100,10 +102,6 @@ public String getRawName() { return name; } - public boolean isRenamed() { - return !getName().equals(getRawName()); - } - public TypeInfo getReturnType() { return new TypeInfo(type, method.getGenericReturnType(), method.getAnnotatedReturnType()); } diff --git a/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/NamedElement.java b/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/NamedElement.java index da32503e3..97937ae11 100644 --- a/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/NamedElement.java +++ b/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/NamedElement.java @@ -5,5 +5,7 @@ public interface NamedElement { String getRawName(); - boolean isRenamed(); + default boolean isRenamed() { + return !getName().equals(getRawName()); + } } diff --git a/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/ParameterInfo.java b/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/ParameterInfo.java index 0ed5ecad5..a09dda34c 100644 --- a/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/ParameterInfo.java +++ b/client/implementation/src/main/java/io/smallrye/graphql/client/impl/typesafe/reflection/ParameterInfo.java @@ -141,11 +141,6 @@ public String getRawName() { return parameter.getName(); } - @Override - public boolean isRenamed() { - return !getName().equals(getRawName()); - } - public A[] getAnnotations(Class type) { return parameter.getAnnotationsByType(type); }