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 Details

    • 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 type
      annotations - 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 annotations
      type - the date type
      Returns:
      potentially a format as a String