Class FormatHelper
- java.lang.Object
-
- io.smallrye.graphql.schema.helper.FormatHelper
-
public class FormatHelper extends Object
Helping with formats of dates and Numbers- Author:
- Phillip Kruger (phillip.kruger@redhat.com)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetDateFormatString(Annotations annotations, org.jboss.jandex.Type type)The the date format as a String This is used to add to the description in the schemastatic Optional<Transformation>getFormat(org.jboss.jandex.Type type, Annotations annotations)Get the format model object for a certain type.static Optional<String>getNumberFormatString(Annotations annotations)The the number format (if any) as a String This is used to add to the description in the schemastatic booleanhasAnyFormatting(Annotations annotations)Test if any formatting is present.
-
-
-
Method Detail
-
hasAnyFormatting
public static boolean hasAnyFormatting(Annotations annotations)
Test if any formatting is present.- Parameters:
annotations- the annotations- Returns:
- if formatting is present
-
getFormat
public static Optional<Transformation> getFormat(org.jboss.jandex.Type type, Annotations annotations)
Get the format model object for a certain type.- Parameters:
type- the typeannotations- the annotations- Returns:
- Potentially a TransformInfo model
-
getNumberFormatString
public static Optional<String> getNumberFormatString(Annotations annotations)
The the number format (if any) as a String This is used to add to the description in the schema- Parameters:
annotations- the annotations- Returns:
- potentially a format as a String
-
getDateFormatString
public static String getDateFormatString(Annotations annotations, org.jboss.jandex.Type type)
The the date format as a String This is used to add to the description in the schema- Parameters:
annotations- the annotationstype- the date type- Returns:
- potentially a format as a String
-
-