Class PermissionSet

    • Constructor Detail

      • PermissionSet

        public PermissionSet()
        Constructs a new empty instance.
      • PermissionSet

        protected PermissionSet​(boolean noInit)
        Constructs a new empty instance.
      • PermissionSet

        public PermissionSet​(JSONObject jsonObject)
        Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • PermissionSet

        public PermissionSet​(PermissionSet src)
        Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
    • Method Detail

      • getId

        public String getId()
        Unique identifier
      • getName

        public String getName()
        Key of the permissionSet
      • getLabel

        public String getLabel()
        Label of the permissionSet
      • getEmployeeDefault

        public Boolean getEmployeeDefault()
      • getManagerDefault

        public Boolean getManagerDefault()
      • getPermissions

        public Permissions getPermissions()
        Bitmap of permissions
      • getRoles

        public List<Reference> getRoles()
        roles enabled for this merchant
      • getModule

        public Reference getModule()
        The module associated with this permission set (if any)
      • getJSONObject

        public JSONObject getJSONObject()
        Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be reflected in this instance and vice-versa.
        Specified by:
        getJSONObject in interface JSONifiable
      • isNotNullId

        public boolean isNotNullId()
        Checks whether the 'id' field is set and is not null
      • isNotNullName

        public boolean isNotNullName()
        Checks whether the 'name' field is set and is not null
      • isNotNullLabel

        public boolean isNotNullLabel()
        Checks whether the 'label' field is set and is not null
      • isNotNullApp

        public boolean isNotNullApp()
        Checks whether the 'app' field is set and is not null
      • isNotNullEmployeeDefault

        public boolean isNotNullEmployeeDefault()
        Checks whether the 'employeeDefault' field is set and is not null
      • isNotNullManagerDefault

        public boolean isNotNullManagerDefault()
        Checks whether the 'managerDefault' field is set and is not null
      • isNotNullPermissions

        public boolean isNotNullPermissions()
        Checks whether the 'permissions' field is set and is not null
      • isNotNullEmployeePermissions

        public boolean isNotNullEmployeePermissions()
        Checks whether the 'employeePermissions' field is set and is not null
      • isNotEmptyEmployeePermissions

        public boolean isNotEmptyEmployeePermissions()
        Checks whether the 'employeePermissions' field is set and is not null and is not empty
      • isNotNullRoles

        public boolean isNotNullRoles()
        Checks whether the 'roles' field is set and is not null
      • isNotEmptyRoles

        public boolean isNotEmptyRoles()
        Checks whether the 'roles' field is set and is not null and is not empty
      • isNotNullModule

        public boolean isNotNullModule()
        Checks whether the 'module' field is set and is not null
      • hasId

        public boolean hasId()
        Checks whether the 'id' field has been set, however the value could be null
      • hasName

        public boolean hasName()
        Checks whether the 'name' field has been set, however the value could be null
      • hasLabel

        public boolean hasLabel()
        Checks whether the 'label' field has been set, however the value could be null
      • hasApp

        public boolean hasApp()
        Checks whether the 'app' field has been set, however the value could be null
      • hasEmployeeDefault

        public boolean hasEmployeeDefault()
        Checks whether the 'employeeDefault' field has been set, however the value could be null
      • hasManagerDefault

        public boolean hasManagerDefault()
        Checks whether the 'managerDefault' field has been set, however the value could be null
      • hasPermissions

        public boolean hasPermissions()
        Checks whether the 'permissions' field has been set, however the value could be null
      • hasEmployeePermissions

        public boolean hasEmployeePermissions()
        Checks whether the 'employeePermissions' field has been set, however the value could be null
      • hasRoles

        public boolean hasRoles()
        Checks whether the 'roles' field has been set, however the value could be null
      • hasModule

        public boolean hasModule()
        Checks whether the 'module' field has been set, however the value could be null
      • setApp

        public PermissionSet setApp​(Reference app)
        Sets the field 'app'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setEmployeeDefault

        public PermissionSet setEmployeeDefault​(Boolean employeeDefault)
        Sets the field 'employeeDefault'.
      • setManagerDefault

        public PermissionSet setManagerDefault​(Boolean managerDefault)
        Sets the field 'managerDefault'.
      • setPermissions

        public PermissionSet setPermissions​(Permissions permissions)
        Sets the field 'permissions'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setEmployeePermissions

        public PermissionSet setEmployeePermissions​(List<EmployeePermission> employeePermissions)
        Sets the field 'employeePermissions'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • setRoles

        public PermissionSet setRoles​(List<Reference> roles)
        Sets the field 'roles'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • setModule

        public PermissionSet setModule​(Reference module)
        Sets the field 'module'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • clearId

        public void clearId()
        Clears the 'id' field, the 'has' method for this field will now return false
      • clearName

        public void clearName()
        Clears the 'name' field, the 'has' method for this field will now return false
      • clearLabel

        public void clearLabel()
        Clears the 'label' field, the 'has' method for this field will now return false
      • clearApp

        public void clearApp()
        Clears the 'app' field, the 'has' method for this field will now return false
      • clearEmployeeDefault

        public void clearEmployeeDefault()
        Clears the 'employeeDefault' field, the 'has' method for this field will now return false
      • clearManagerDefault

        public void clearManagerDefault()
        Clears the 'managerDefault' field, the 'has' method for this field will now return false
      • clearPermissions

        public void clearPermissions()
        Clears the 'permissions' field, the 'has' method for this field will now return false
      • clearEmployeePermissions

        public void clearEmployeePermissions()
        Clears the 'employeePermissions' field, the 'has' method for this field will now return false
      • clearRoles

        public void clearRoles()
        Clears the 'roles' field, the 'has' method for this field will now return false
      • clearModule

        public void clearModule()
        Clears the 'module' field, the 'has' method for this field will now return false
      • containsChanges

        public boolean containsChanges()
        Returns true if this instance has any changes.
      • resetChangeLog

        public void resetChangeLog()
        Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
      • copyChanges

        public PermissionSet copyChanges()
        Create a copy of this instance that contains only fields that were set after the constructor was called.
      • mergeChanges

        public void mergeChanges​(PermissionSet src)
        Copy all the changed fields from the given source to this instance.