Skip to content

Commit f192013

Browse files
authored
4.x: Remove duplicated methods from CustomScalars (helidon-io#9474)
1 parent b5759b3 commit f192013

File tree

1 file changed

+3
-37
lines changed
  • microprofile/graphql/server/src/main/java/io/helidon/microprofile/graphql/server

1 file changed

+3
-37
lines changed

microprofile/graphql/server/src/main/java/io/helidon/microprofile/graphql/server/CustomScalars.java

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2022 Oracle and/or its affiliates.
2+
* Copyright (c) 2020, 2024 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -103,13 +103,13 @@ private CustomScalars() {
103103
* An instance of a custom offset date/time scalar (with default formatting).
104104
*/
105105
static final GraphQLScalarType CUSTOM_OFFSET_DATE_TIME_SCALAR =
106-
newOffsetDateTimeScalar(FORMATTED_OFFSET_DATETIME_SCALAR);
106+
newDateTimeScalar(FORMATTED_OFFSET_DATETIME_SCALAR);
107107

108108
/**
109109
* An instance of a custom offset date/time scalar (with default formatting).
110110
*/
111111
static final GraphQLScalarType CUSTOM_ZONED_DATE_TIME_SCALAR =
112-
newZonedDateTimeScalar(FORMATTED_ZONED_DATETIME_SCALAR);
112+
newDateTimeScalar(FORMATTED_ZONED_DATETIME_SCALAR);
113113

114114
/**
115115
* An instance of a custom time scalar (with default formatting).
@@ -137,40 +137,6 @@ static GraphQLScalarType newDateTimeScalar(String name) {
137137
.build();
138138
}
139139

140-
/**
141-
* Return a new custom offset date/time scalar.
142-
*
143-
* @param name the name of the scalar
144-
* @return a new custom date/time scalar
145-
*/
146-
@SuppressWarnings("unchecked")
147-
static GraphQLScalarType newOffsetDateTimeScalar(String name) {
148-
GraphQLScalarType originalScalar = ExtendedScalars.DateTime;
149-
150-
return GraphQLScalarType.newScalar()
151-
.coercing(new DateTimeCoercing())
152-
.name(name)
153-
.description("Custom: " + originalScalar.getDescription())
154-
.build();
155-
}
156-
157-
/**
158-
* Return a new custom zoned date/time scalar.
159-
*
160-
* @param name the name of the scalar
161-
* @return a new custom date/time scalar
162-
*/
163-
@SuppressWarnings("unchecked")
164-
static GraphQLScalarType newZonedDateTimeScalar(String name) {
165-
GraphQLScalarType originalScalar = ExtendedScalars.DateTime;
166-
167-
return GraphQLScalarType.newScalar()
168-
.coercing(new DateTimeCoercing())
169-
.name(name)
170-
.description("Custom: " + originalScalar.getDescription())
171-
.build();
172-
}
173-
174140
/**
175141
* Return a new custom time scalar.
176142
*

0 commit comments

Comments
 (0)