Class ScalarUtils

java.lang.Object
no.sikt.graphitron.definitions.helpers.ScalarUtils

public class ScalarUtils extends Object
  • Method Details

    • getInstance

      public static ScalarUtils getInstance()
    • initialize

      public static ScalarUtils initialize(Set<Class<?>> definitionsClasses)
    • getBuiltInScalarNames

      public Set<String> getBuiltInScalarNames()
      Returns:
      the names of the built-in scalar types supported by GraphQL Java.
    • getScalarTypeCodeBlockMapping

      public Map<String,CodeBlock> getScalarTypeCodeBlockMapping()
      Returns:
      a map of scalar names to CodeBlocks representing the code to access the scalar field. E.g "BigDecimal" -> "ExtendedScalars.GraphQLBigDecimal". This is used to automatically add scalar types to the wiring.
    • getScalarTypeNameMapping

      public Map<String,String> getScalarTypeNameMapping()
      Returns:
      a map of all supported scalar names to their corresponding Java class names.
    • getScalarTypeMapping

      public ClassName getScalarTypeMapping(String scalarName)
      Returns:
      the java ClassName type mapping for a supported scalar type. Null if the scalar is not supported.