Class RestrictRelationRemovalContribution

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

public class RestrictRelationRemovalContribution extends Object
  • Constructor Details

    • RestrictRelationRemovalContribution

      public RestrictRelationRemovalContribution()
  • Method Details

    • getEntityModel

      public String getEntityModel()
    • setEntityModel

      public void setEntityModel(String entityModel)
    • getBlockingRelationsAsSet

      public Set<String> getBlockingRelationsAsSet()
    • setBlockingRelations

      public void setBlockingRelations(String blockingRelations)
    • getRestrictedRelationsAsSet

      public Set<String> getRestrictedRelationsAsSet()
    • setRestrictedRelations

      public void setRestrictedRelations(String restrictedRelations)
    • getErrorMessage

      public String getErrorMessage()
    • setErrorMessage

      public void setErrorMessage(String errorMessage)
    • getRestrictPredicate

      @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

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

      @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

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