Class NavFunction
- java.lang.Object
-
- de.aristaflow.adept2.model.orgmodel.NavFunction
-
- All Implemented Interfaces:
Serializable
public class NavFunction extends Object implements Serializable
An instance ofNavFunction
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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NavFunction
getFunction(EntityType entType, String functionName)
Returns theNavFunction
object for the function with the given name for the given entity type.static NavFunction[]
getFunctionsFor(EntityType entType)
Returns all functions defined for the given entity type.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.boolean
hasTransitiveOption()
Returns whether the function has the option to be transitive, i.e. whether appending+
to the function name is allowed.boolean
isLeftToRight()
Returns whether the traversal along the relation type is fromRelationType.leftHandEntityType()
toRelationType.rightHandEntityType()
or the other way around.String
policyToken()
Returns the name of this function as it can be used in OrgPolicies.RelationType
relationType()
Returns the relation type along which this function will traverse the organisational model.EntityType
source()
Returns the source entity type of this function, i.e. the type this function can be applied to.EntityType
target()
Returns the target entity type of this function, i.e. the resulting type after applying this function.String
toString()
-
-
-
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
-
isLeftToRight
public boolean isLeftToRight()
Returns whether the traversal along the relation type is fromRelationType.leftHandEntityType()
toRelationType.rightHandEntityType()
or the other way around.- Returns:
- whether the traversal along the relation type is from left to right or the other way around
-
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 theNavFunction
object for the function with the given name for the given entity type.- Parameters:
entType
- the entity type for which the function is definedfunctionName
- 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
-
-