Class NormalizedInputValue


  • @PublicApi
    public class NormalizedInputValue
    extends java.lang.Object
    An argument value with type information.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String typeName  
      private java.lang.Object value  
    • Constructor Summary

      Constructors 
      Constructor Description
      NormalizedInputValue​(java.lang.String typeName, java.lang.Object value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.String assertValidTypeName​(java.lang.String typeName)  
      boolean equals​(java.lang.Object o)  
      java.lang.String getTypeName()
      This can be a wrapped type: e.g.
      java.lang.String getUnwrappedTypeName()  
      java.lang.Object getValue()
      Depending on the type it returns: Scalar or Enum: the ast literal of the Scalar.
      int hashCode()  
      boolean isListLike()  
      private boolean isListOnly​(java.lang.String typeName)  
      boolean isNonNullable()  
      boolean isNullable()  
      private boolean isWrapped​(java.lang.String typeName)  
      java.lang.String toString()  
      private java.lang.String unwrapAll​(java.lang.String typeName)  
      private java.lang.String unwrapOne​(java.lang.String typeName)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • typeName

        private final java.lang.String typeName
      • value

        private final java.lang.Object value
    • Constructor Detail

      • NormalizedInputValue

        public NormalizedInputValue​(java.lang.String typeName,
                                    java.lang.Object value)
    • Method Detail

      • assertValidTypeName

        private java.lang.String assertValidTypeName​(java.lang.String typeName)
      • unwrapAll

        private java.lang.String unwrapAll​(java.lang.String typeName)
      • getTypeName

        public java.lang.String getTypeName()
        This can be a wrapped type: e.g. [String!]!
        Returns:
        the type name
      • getUnwrappedTypeName

        public java.lang.String getUnwrappedTypeName()
        Returns:
        the type name unwrapped of all list and non-null type wrapping
      • getValue

        public java.lang.Object getValue()
        Depending on the type it returns: Scalar or Enum: the ast literal of the Scalar. InputObject: the value is a map of field-name to NormalizedInputValue List of Scalar literal or Enum literal or NormalizedInput (or even List of List ..)
        Returns:
        the value
      • isListLike

        public boolean isListLike()
        Returns:
        true if the input value type is a list or a non-nullable list
      • isNonNullable

        public boolean isNonNullable()
        Returns:
        true if the input value type is non-nullable
      • isNullable

        public boolean isNullable()
        Returns:
        true if the input value type is nullable
      • isWrapped

        private boolean isWrapped​(java.lang.String typeName)
      • isListOnly

        private boolean isListOnly​(java.lang.String typeName)
      • unwrapOne

        private java.lang.String unwrapOne​(java.lang.String typeName)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object