class RuleExecutionUtils {

    public static boolean ifFilterMatchesTheCurrentResource(Map<String, String> ruleParam,
            Map<String, String> resource) {

        String ruleParam_account = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.ACCOUNT_ID))
                ? ruleParam.get(PacmanSdkConstants.ACCOUNT_ID) : resource.get(PacmanSdkConstants.ACCOUNT_ID);
        String ruleParam_region = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.REGION))
                ? ruleParam.get(PacmanSdkConstants.REGION) : resource.get(PacmanSdkConstants.REGION);
        String ruleParam_resourceId = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.RESOURCE_ID))
                ? ruleParam.get(PacmanSdkConstants.RESOURCE_ID) : resource.get(PacmanSdkConstants.RESOURCE_ID);

        String ruleString = new StringBuilder(ruleParam_account).append(ruleParam_region).append(ruleParam_resourceId)
                .toString();
        String resourceString = new StringBuilder(resource.get(PacmanSdkConstants.ACCOUNT_ID))
                .append(resource.get(PacmanSdkConstants.REGION)).append(resource.get(PacmanSdkConstants.RESOURCE_ID))
                .toString();
        ;

        return ruleString.equals(resourceString);

    }

}