Class ServiceBindingUtils
java.lang.Object
com.sap.cds.services.utils.environment.ServiceBindingUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns true, if a service binding matches the given filter.static booleanmatches(com.sap.cloud.environment.servicebinding.api.ServiceBinding binding, String tagFilter, String serviceNameFilter) Returns true, if a service binding matches the given tag filter or service filter.
-
Method Details
-
matches
public static boolean matches(com.sap.cloud.environment.servicebinding.api.ServiceBinding binding, String tagFilter, String serviceNameFilter) Returns true, if a service binding matches the given tag filter or service filter.The tag filter is used first to match the service binding. It is only used if the given tag filter is not
nulland if the service binding has a non-empty tag list (ServiceBinding.getTags()). If the tag filter is used and no tag match can be found the serviceFilter is applied.If the tag filter is not used or has a negative result an additional service filter is applied against the service name of the binding. It is only applied if the given service filter is not
null.- Parameters:
binding- theServiceBindingto checktagFilter- the tag to match the tags against.serviceNameFilter- the service name to match the service against.- Returns:
- true, if the service binding matches, false otherwise
-
matches
public static boolean matches(com.sap.cloud.environment.servicebinding.api.ServiceBinding binding, String filter) Returns true, if a service binding matches the given filter. The filter is used as tag filter and service filter.- Parameters:
binding- theServiceBindingto checkfilter- the filter to match tags and service against- Returns:
- true, if the service binding matches, false otherwise
-