Class RestrictRelationRemovalContribution

java.lang.Object
ch.tocco.nice2.usermanager.impl.businessunit.RestrictRelationRemovalContribution

public class RestrictRelationRemovalContribution extends Object
  • Constructor Details Link icon

    • RestrictRelationRemovalContribution Link icon

      public RestrictRelationRemovalContribution()
  • Method Details Link icon

    • getEntityModel Link icon

      public String getEntityModel()
    • setEntityModel Link icon

      public void setEntityModel(String entityModel)
    • getBlockingRelationsAsSet Link icon

      public Set<String> getBlockingRelationsAsSet()
    • setBlockingRelations Link icon

      public void setBlockingRelations(String blockingRelations)
    • getRestrictedRelationsAsSet Link icon

      public Set<String> getRestrictedRelationsAsSet()
    • setRestrictedRelations Link icon

      public void setRestrictedRelations(String restrictedRelations)
    • getErrorMessage Link icon

      public String getErrorMessage()
    • setErrorMessage Link icon

      public void setErrorMessage(String errorMessage)
    • getRestrictPredicate Link icon

      @Nullable public @Nullable BiPredicate<Relation,Entity> getRestrictPredicate()
      Instead of always restricting the removal of relation X if relation Y is set, this method allows to provide an additional condition that needs to evaluate to true to deny the removal. This predicate is applied to each set blocking relation to determine whether the removal should be restricted.
      Returns:
      a BiPredicate that receives the set blocking relation that is currently being tested as first argument and the entity to be removed as second argument
    • setRestrictPredicate Link icon

      public void setRestrictPredicate(BiPredicate<Relation,Entity> restrictPredicate)
    • getErrorMessageFormatter Link icon

      @Nullable public @Nullable BiFunction<Entity,Set<String>,TextMessage> getErrorMessageFormatter()
      Returns:
      a function to create a text message. This function receives the entity that couldn't be deleted and a set with all text resources for the relations that caused the removal to fail.
    • setErrorMessageFormatter Link icon

      public void setErrorMessageFormatter(BiFunction<Entity,Set<String>,TextMessage> errorMessageFormatter)