Class Check


  • public final class Check
    extends Object
    INTERNAL: Provides various argument constraint checks.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void datatypeNotNull​(org.tmapi.core.Locator loc)
      Throws a IllegalArgumentException if the datatype is null
      static void itemIdentifierNotNull​(org.tmapi.core.Construct sender, org.tmapi.core.Locator loc)  
      static void locatorNotNull​(org.tmapi.core.Locator loc)
      Throws a IllegalArgumentException if the locator is null
      static void playerInTopicMap​(org.tmapi.core.TopicMap topicMap, org.tmapi.core.Topic player)
      Checks if the player is in the topic map
      static void playerNotNull​(org.tmapi.core.Construct sender, org.tmapi.core.Topic player)
      Throws a ModelConstraintException iff the player is null.
      static void reifierInTopicMap​(org.tmapi.core.TopicMap topicMap, org.tmapi.core.Topic reifier)
      Checks if the reifier is in the topic map
      static void scopeInTopicMap​(org.tmapi.core.TopicMap topicMap, org.tmapi.core.Topic... scope)
      Checks if the scope is in the topic map
      static void scopeNotEmpty​(org.tmapi.core.Construct sender, Collection<org.tmapi.core.Topic> scope)
      Throws a ModelConstraintException iff the scope is empty.
      static void scopeNotEmpty​(org.tmapi.core.Construct sender, org.tmapi.core.Topic[] scope)
      Throws a ModelConstraintException iff the scope is empty.
      static void scopeNotNull​(org.tmapi.core.Construct sender, Collection<org.tmapi.core.Topic> scope)
      Throws a ModelConstraintException iff the scope is null.
      static void scopeNotNull​(org.tmapi.core.Construct sender, org.tmapi.core.Topic[] scope)
      Throws a ModelConstraintException iff the scope is null.
      static void subjectIdentifierNotNull​(org.tmapi.core.Construct sender, org.tmapi.core.Locator loc)  
      static void subjectIdentifierNotNull​(org.tmapi.core.Locator sid)
      Throws a IllegalArgumentException if the subject identifier is null
      static void subjectLocatorNotNull​(org.tmapi.core.Construct sender, org.tmapi.core.Locator loc)  
      static void subjectLocatorNotNull​(org.tmapi.core.Locator loc)
      Throws a IllegalArgumentException if the subject locator is null
      static void themeNotNull​(org.tmapi.core.Construct sender, org.tmapi.core.Topic theme)
      Throws a ModelConstraintException iff the theme is null.
      static void themeNotNull​(org.tmapi.core.Topic theme)
      Throws a IllegalArgumentException iff the theme is null.
      static void themeNotNull​(org.tmapi.core.Topic... themes)
      Throws a IllegalArgumentException iff the theme is null.
      static void typeInTopicMap​(org.tmapi.core.TopicMap topicMap, org.tmapi.core.Topic type)
      Checks if the type is in the topic map
      static void typeNotNull​(org.tmapi.core.Construct sender, org.tmapi.core.Topic type)
      Throws a ModelConstraintException iff the type is null.
      static void typeNotNull​(org.tmapi.core.Topic type)
      Throws a IllegalArgumentException iff the type is null.
      static void valueNotNull​(Object value)
      Throws a IllegalArgumentException if the value is null
      static void valueNotNull​(org.tmapi.core.Construct sender, Object value)
      Throws a ModelConstraintException iff the value is null.
      static void valueNotNull​(org.tmapi.core.Construct sender, Object value, org.tmapi.core.Locator datatype)
      Throws a ModelConstraintException iff the value or the datatype is null.
    • Method Detail

      • scopeNotNull

        public static void scopeNotNull​(org.tmapi.core.Construct sender,
                                        org.tmapi.core.Topic[] scope)
        Throws a ModelConstraintException iff the scope is null.
        Parameters:
        sender - The sender.
        scope - The scope.
      • themeNotNull

        public static void themeNotNull​(org.tmapi.core.Construct sender,
                                        org.tmapi.core.Topic theme)
        Throws a ModelConstraintException iff the theme is null.
        Parameters:
        sender - The sender.
        theme - The theme.
      • scopeNotNull

        public static void scopeNotNull​(org.tmapi.core.Construct sender,
                                        Collection<org.tmapi.core.Topic> scope)
        Throws a ModelConstraintException iff the scope is null.
        Parameters:
        sender - The sender.
        scope - The scope.
      • scopeNotEmpty

        public static void scopeNotEmpty​(org.tmapi.core.Construct sender,
                                         Collection<org.tmapi.core.Topic> scope)
        Throws a ModelConstraintException iff the scope is empty.
        Parameters:
        sender - The sender.
        scope - The scope.
      • scopeNotEmpty

        public static void scopeNotEmpty​(org.tmapi.core.Construct sender,
                                         org.tmapi.core.Topic[] scope)
        Throws a ModelConstraintException iff the scope is empty.
        Parameters:
        sender - The sender.
        scope - The scope.
      • typeNotNull

        public static void typeNotNull​(org.tmapi.core.Construct sender,
                                       org.tmapi.core.Topic type)
        Throws a ModelConstraintException iff the type is null.
        Parameters:
        sender - The sender.
        type - The type.
      • valueNotNull

        public static void valueNotNull​(org.tmapi.core.Construct sender,
                                        Object value)
        Throws a ModelConstraintException iff the value is null.
        Parameters:
        sender - The sender.
        value - The value.
      • valueNotNull

        public static void valueNotNull​(org.tmapi.core.Construct sender,
                                        Object value,
                                        org.tmapi.core.Locator datatype)
        Throws a ModelConstraintException iff the value or the datatype is null.
        Parameters:
        sender - The sender.
        value - The value.
        datatype - The datatype.
      • playerNotNull

        public static void playerNotNull​(org.tmapi.core.Construct sender,
                                         org.tmapi.core.Topic player)
        Throws a ModelConstraintException iff the player is null.
        Parameters:
        sender - The sender.
        player - The player.
      • subjectIdentifierNotNull

        public static void subjectIdentifierNotNull​(org.tmapi.core.Construct sender,
                                                    org.tmapi.core.Locator loc)
      • subjectLocatorNotNull

        public static void subjectLocatorNotNull​(org.tmapi.core.Construct sender,
                                                 org.tmapi.core.Locator loc)
      • itemIdentifierNotNull

        public static void itemIdentifierNotNull​(org.tmapi.core.Construct sender,
                                                 org.tmapi.core.Locator loc)
      • subjectLocatorNotNull

        public static void subjectLocatorNotNull​(org.tmapi.core.Locator loc)
        Throws a IllegalArgumentException if the subject locator is null
        Parameters:
        loc - the locator to check
      • subjectIdentifierNotNull

        public static void subjectIdentifierNotNull​(org.tmapi.core.Locator sid)
        Throws a IllegalArgumentException if the subject identifier is null
        Parameters:
        sid - the identifier to check
      • valueNotNull

        public static void valueNotNull​(Object value)
        Throws a IllegalArgumentException if the value is null
        Parameters:
        value - the value to check
      • locatorNotNull

        public static void locatorNotNull​(org.tmapi.core.Locator loc)
        Throws a IllegalArgumentException if the locator is null
        Parameters:
        loc - the locator to check
      • datatypeNotNull

        public static void datatypeNotNull​(org.tmapi.core.Locator loc)
        Throws a IllegalArgumentException if the datatype is null
        Parameters:
        loc - the locator to check
      • themeNotNull

        public static void themeNotNull​(org.tmapi.core.Topic theme)
        Throws a IllegalArgumentException iff the theme is null.
        Parameters:
        theme - The theme.
      • themeNotNull

        public static void themeNotNull​(org.tmapi.core.Topic... themes)
        Throws a IllegalArgumentException iff the theme is null.
        Parameters:
        themes - The array of themes.
      • typeNotNull

        public static void typeNotNull​(org.tmapi.core.Topic type)
        Throws a IllegalArgumentException iff the type is null.
        Parameters:
        type - The type.
      • scopeInTopicMap

        public static void scopeInTopicMap​(org.tmapi.core.TopicMap topicMap,
                                           org.tmapi.core.Topic... scope)
        Checks if the scope is in the topic map
        Parameters:
        topicMap - the topicMap creating a scoped statement
        scope - an array of themes (scope types)
        Throws:
        org.tmapi.core.ModelConstraintException - if a theme is not part of the topic map
      • typeInTopicMap

        public static void typeInTopicMap​(org.tmapi.core.TopicMap topicMap,
                                          org.tmapi.core.Topic type)
        Checks if the type is in the topic map
        Parameters:
        topicMap - the topicMap creating a typed construct
        type - type to check
        Throws:
        org.tmapi.core.ModelConstraintException - if the type is not part of the topic map
      • reifierInTopicMap

        public static void reifierInTopicMap​(org.tmapi.core.TopicMap topicMap,
                                             org.tmapi.core.Topic reifier)
        Checks if the reifier is in the topic map
        Parameters:
        topicMap - the topicMap creating a typed construct
        reifier - reifier to check
        Throws:
        org.tmapi.core.ModelConstraintException - if the reifier is not part of the topic map
      • playerInTopicMap

        public static void playerInTopicMap​(org.tmapi.core.TopicMap topicMap,
                                            org.tmapi.core.Topic player)
        Checks if the player is in the topic map
        Parameters:
        topicMap - the topicMap creating a typed construct
        player - player to check
        Throws:
        org.tmapi.core.ModelConstraintException - if the player is not part of the topic map