Class MetadataTypeUtils


  • public final class MetadataTypeUtils
    extends Object
    Utilities for handling values
    Since:
    1.0
    • Method Detail

      • checkArgument

        public static void checkArgument​(boolean condition,
                                         String message)
        Parameters:
        condition - Condition that the argument must satisfy
        message - The Message of the exception in case the condition is invalid
      • addTypeAlias

        public static void addTypeAlias​(TypeBuilder typeBuilder,
                                        String typeAlias)
        Gives a type alias to type specified by builder.
        Parameters:
        typeBuilder - The type builder to annotate.
        typeAlias - The type alias to use.
      • getDefaultValue

        public static Optional<String> getDefaultValue​(MetadataType type)
        Returns the default value of a MetadataType if exist.
        Parameters:
        type - the metadata type to search de default value from.
      • isVoid

        public static boolean isVoid​(MetadataType type)
        Returns whether a metadata type is an instance of VoidType or not.
        Parameters:
        type - the metadata type to check.
      • isNullType

        public static boolean isNullType​(MetadataType type)
        Returns whether a metadata type is an instance of NullType or not.
        Parameters:
        type - the metadata type to check.
      • isCollection

        public static boolean isCollection​(MetadataType type)
        Returns whether a metadata type is an instance of an ArrayType or not.
        Parameters:
        type - the metadata type to check.
      • isObjectType

        public static boolean isObjectType​(MetadataType type)
        Returns whether a metadata type is an instance of ObjectType or not.
        Parameters:
        type - the metadata type to check.
      • hasExposedFields

        public static boolean hasExposedFields​(MetadataType type)
        Returns if an ObjectType has at least one exposed field or not, for any other MetadataType returns false.
        Parameters:
        type - the metadata type to check.
      • hashCode

        public static int hashCode​(Optional<?>... optionals)
      • isNotNull

        public static boolean isNotNull​(Object object)
        Checks if the given object is null or not