Skip to content

Commit e370d2a

Browse files
committed
More JavaDoc
1 parent 64bb8d5 commit e370d2a

File tree

1 file changed

+84
-4
lines changed

1 file changed

+84
-4
lines changed

src/main/java/graphql/scalars/ExtendedScalars.java

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package graphql.scalars;
22

33
import graphql.PublicApi;
4-
import graphql.scalars.datetime.DateTimeScalar;
54
import graphql.scalars.datetime.DateScalar;
5+
import graphql.scalars.datetime.DateTimeScalar;
66
import graphql.scalars.datetime.TimeScalar;
77
import graphql.scalars.numeric.NegativeFloatScalar;
88
import graphql.scalars.numeric.NegativeIntScalar;
@@ -17,12 +17,49 @@
1717
import graphql.scalars.url.UrlScalar;
1818
import graphql.schema.GraphQLScalarType;
1919

20+
/**
21+
* This is the API entry point for all the extended scalars
22+
*/
2023
@PublicApi
2124
public class ExtendedScalars {
2225

23-
26+
/**
27+
* An RFC-3339 compliant date time scalar that accepts string values like `1996-12-19T16:39:57-08:00` and produces
28+
* `java.time.OffsetDateTime` objects at runtime.
29+
* <p>
30+
* Its {@link graphql.schema.Coercing#serialize(java.lang.Object)} and {@link graphql.schema.Coercing#parseValue(java.lang.Object)} methods
31+
* accept OffsetDateTime, ZoneDateTime and formatted Strings as valid objects.
32+
* <p>
33+
* See the <a href="https://www.ietf.org/rfc/rfc3339.txt">rfc3339 spec</a> for more details on the format.
34+
*
35+
* @see java.time.OffsetDateTime
36+
* @see java.time.ZonedDateTime
37+
*/
2438
public static GraphQLScalarType DateTime = new DateTimeScalar();
39+
40+
/**
41+
* An RFC-3339 compliant date scalar that accepts string values like `1996-12-19` and produces
42+
* `java.time.LocalDate` objects at runtime.
43+
* <p>
44+
* Its {@link graphql.schema.Coercing#serialize(java.lang.Object)} and {@link graphql.schema.Coercing#parseValue(java.lang.Object)} methods
45+
* accept date {@link java.time.temporal.TemporalAccessor}s and formatted Strings as valid objects.
46+
* <p>
47+
* See the <a href="https://www.ietf.org/rfc/rfc3339.txt">rfc3339 spec</a> for more details on the format.
48+
*
49+
* @see java.time.LocalDate
50+
*/
2551
public static GraphQLScalarType Date = new DateScalar();
52+
/**
53+
* An RFC-3339 compliant time scalar that accepts string values like `6:39:57-08:00` and produces
54+
* `java.time.OffsetTime` objects at runtime.
55+
* <p>
56+
* Its {@link graphql.schema.Coercing#serialize(java.lang.Object)} and {@link graphql.schema.Coercing#parseValue(java.lang.Object)} methods
57+
* accept time {@link java.time.temporal.TemporalAccessor}s and formatted Strings as valid objects.
58+
* <p>
59+
* See the <a href="https://www.ietf.org/rfc/rfc3339.txt">rfc3339 spec</a> for more details on the format.
60+
*
61+
* @see java.time.OffsetTime
62+
*/
2663
public static GraphQLScalarType Time = new TimeScalar();
2764

2865
/**
@@ -62,20 +99,63 @@ public class ExtendedScalars {
6299
* }
63100
* }
64101
* </pre>
102+
*
103+
* @see graphql.scalars.ExtendedScalars#Object
65104
*/
66105
public static GraphQLScalarType Json = new JsonScalar();
67106

107+
/**
108+
* A URL scalar that accepts URL strings and produces {@link java.net.URL} objects at runtime
109+
*/
68110
public static GraphQLScalarType Url = new UrlScalar();
69111

112+
/**
113+
* An `Int` scalar that MUST be greater than zero
114+
*
115+
* @see graphql.Scalars#GraphQLInt
116+
*/
70117
public static GraphQLScalarType PositiveInt = new PositiveIntScalar();
118+
/**
119+
* An `Int` scalar that MUST be less than zero
120+
*
121+
* @see graphql.Scalars#GraphQLInt
122+
*/
71123
public static GraphQLScalarType NegativeInt = new NegativeIntScalar();
124+
/**
125+
* An `Int` scalar that MUST be less than or equal to zero
126+
*
127+
* @see graphql.Scalars#GraphQLInt
128+
*/
72129
public static GraphQLScalarType NonPositiveInt = new NonPositiveIntScalar();
130+
/**
131+
* An `Int` scalar that MUST be greater than or equal to zero
132+
*
133+
* @see graphql.Scalars#GraphQLInt
134+
*/
73135
public static GraphQLScalarType NonNegativeInt = new NonNegativeIntScalar();
74136

137+
/**
138+
* An `Float` scalar that MUST be greater than zero
139+
*
140+
* @see graphql.Scalars#GraphQLFloat
141+
*/
75142
public static GraphQLScalarType PositiveFloat = new PositiveFloatScalar();
143+
/**
144+
* An `Float` scalar that MUST be less than zero
145+
*
146+
* @see graphql.Scalars#GraphQLFloat
147+
*/
76148
public static GraphQLScalarType NegativeFloat = new NegativeFloatScalar();
149+
/**
150+
* An `Float` scalar that MUST be less than or equal to zero
151+
*
152+
* @see graphql.Scalars#GraphQLFloat
153+
*/
77154
public static GraphQLScalarType NonPositiveFloat = new NonPositiveFloatScalar();
155+
/**
156+
* An `Float` scalar that MUST be greater than or equal to zero
157+
*
158+
* @see graphql.Scalars#GraphQLFloat
159+
*/
78160
public static GraphQLScalarType NonNegativeFloat = new NonNegativeFloatScalar();
79-
80-
81161
}

0 commit comments

Comments
 (0)