Class NavFunction

  • All Implemented Interfaces:
    Serializable

    public class NavFunction
    extends Object
    implements Serializable
    An instance of NavFunction represents the definition of a navigational function that may appear in OrgPolicies, i.e. it does not describe an actual instance of the function in a specific OrgPolicy.

    Function names are (like entity types and attribute names) NOT case sensitive.

    Author:
    Patrick Schmidt
    See Also:
    Serialized Form
    • Method Detail

      • policyToken

        public String policyToken()
        Returns the name of this function as it can be used in OrgPolicies.
        Returns:
        the name of this function
      • source

        public EntityType source()
        Returns the source entity type of this function, i.e. the type this function can be applied to.
        Returns:
        the source entity type of this function
      • target

        public EntityType target()
        Returns the target entity type of this function, i.e. the resulting type after applying this function.
        Returns:
        the target entity type of this function
      • hasTransitiveOption

        public boolean hasTransitiveOption()
        Returns whether the function has the option to be transitive, i.e. whether appending + to the function name is allowed.
        Returns:
        whether the function has the option to be transitive
      • relationType

        public RelationType relationType()
        Returns the relation type along which this function will traverse the organisational model.
        Returns:
        the relation type along which this function will traverse the organisational model
      • getFunctionsFor

        public static NavFunction[] getFunctionsFor​(EntityType entType)
        Returns all functions defined for the given entity type.
        Parameters:
        entType - the entity type for which to return the functions
        Returns:
        the defined functions for the given entity type
      • getFunction

        public static NavFunction getFunction​(EntityType entType,
                                              String functionName)
        Returns the NavFunction object for the function with the given name for the given entity type.
        Parameters:
        entType - the entity type for which the function is defined
        functionName - the name of the desired function
        Returns:
        the NavFunction object of the desired function
        Throws:
        IllegalArgumentException - if the function does not exist
      • getFunctionsFor

        public static NavFunction[] getFunctionsFor​(RelationType relType)
        Returns a two-element array containing the left-to-right and right-to-left navigational function associated with the specified relation type.
        Parameters:
        relType - the relation type for which to return the two navigational functions
        Returns:
        a two-element array containing the left-to-right and right-to-left navigational function associated with the specified relation type