package com.cloudhandson.vpdbackoffice.service;

import java.util.List;
import java.util.Set;

public interface MaskingPolicyCatalog {
  List<MaskingPolicyTarget> targets();

  default Set<String> objectNames() {
    return targets().stream().map(MaskingPolicyTarget::objectName).collect(java.util.stream.Collectors.toUnmodifiableSet());
  }

  default boolean containsObject(String objectName) {
    return objectName != null && objectNames().contains(objectName.trim().toUpperCase(java.util.Locale.ROOT));
  }
}
