- throws ToscaPolicyConversionException {
- switch (function.toLowerCase()) {
- case "string-equal":
- return XACML3.ID_FUNCTION_STRING_EQUAL;
- case "string-equal-ignore-case":
- return XACML3.ID_FUNCTION_STRING_EQUAL_IGNORE_CASE;
- case "string-regexp-match":
- return XACML3.ID_FUNCTION_STRING_REGEXP_MATCH;
- case "string-contains":
- return XACML3.ID_FUNCTION_STRING_CONTAINS;
- case "string-greater-than":
- return XACML3.ID_FUNCTION_STRING_GREATER_THAN;
- case "string-greater-than-or-equal":
- return XACML3.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL;
- case "string-less-than":
- return XACML3.ID_FUNCTION_STRING_LESS_THAN;
- case "string-less-than-or-equal":
- return XACML3.ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL;
- case "string-starts-with":
- return XACML3.ID_FUNCTION_STRING_STARTS_WITH;
- case "string-ends-with":
- return XACML3.ID_FUNCTION_STRING_ENDS_WITH;
- default:
- throw new ToscaPolicyConversionException("Unexpected value for function in filter");
- }
+ throws ToscaPolicyConversionException {
+ return switch (function.toLowerCase()) {
+ case "string-equal" -> XACML3.ID_FUNCTION_STRING_EQUAL;
+ case "string-equal-ignore-case" -> XACML3.ID_FUNCTION_STRING_EQUAL_IGNORE_CASE;
+ case "string-regexp-match" -> XACML3.ID_FUNCTION_STRING_REGEXP_MATCH;
+ case "string-contains" -> XACML3.ID_FUNCTION_STRING_CONTAINS;
+ case "string-greater-than" -> XACML3.ID_FUNCTION_STRING_GREATER_THAN;
+ case "string-greater-than-or-equal" -> XACML3.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL;
+ case "string-less-than" -> XACML3.ID_FUNCTION_STRING_LESS_THAN;
+ case "string-less-than-or-equal" -> XACML3.ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL;
+ case "string-starts-with" -> XACML3.ID_FUNCTION_STRING_STARTS_WITH;
+ case "string-ends-with" -> XACML3.ID_FUNCTION_STRING_ENDS_WITH;
+ default -> throw new ToscaPolicyConversionException("Unexpected value for function in filter");
+ };