Class ModelUtils


  • public class ModelUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ModelUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getModuleForObjectTypeRelation​(dev.openfga.sdk.api.model.TypeDefinition typeDef, java.lang.String relation)
      getModuleForObjectTypeRelation returns the module for the given object type and relation in that type.
      static boolean isRelationAssignable​(dev.openfga.sdk.api.model.Userset relDef)
      isRelationAssignable returns true if the relation is assignable, as in the relation definition has a key "this" or any of its children have a key "this".
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ModelUtils

        public ModelUtils()
    • Method Detail

      • getModuleForObjectTypeRelation

        public static java.lang.String getModuleForObjectTypeRelation​(dev.openfga.sdk.api.model.TypeDefinition typeDef,
                                                                      java.lang.String relation)
                                                               throws java.lang.Exception
        getModuleForObjectTypeRelation returns the module for the given object type and relation in that type.
        Parameters:
        typeDef - A TypeDefinition object which contains metadata about the type.
        relation - A string representing the relation whose module is to be retrieved.
        Returns:
        A string representing the module for the given object type and relation.
        Throws:
        java.lang.Exception - An error if the relation does not exist.
      • isRelationAssignable

        public static boolean isRelationAssignable​(dev.openfga.sdk.api.model.Userset relDef)
        isRelationAssignable returns true if the relation is assignable, as in the relation definition has a key "this" or any of its children have a key "this".
        Parameters:
        relDef - A Userset object representing a relation definition.
        Returns:
        A boolean representing whether the relation definition has a key "this".