code: public static String filterToFilterSpec(final ModelNode value) throws OperationFailedException {
          if (value.isDefined()) {
              final StringBuilder result = new StringBuilder();
              filterToFilterSpec(value, result, false);
              if (result.length() == 0) {
                  final String name = value.hasDefined(CommonAttributes.FILTER.getName()) ? value.get(CommonAttributes.FILTER.getName()).asString() : value.asString();
                  throw Logging.createOperationFailure(LoggingLogger.ROOT_LOGGER.invalidFilter(name));
              }
              return result.toString();
          }
          return "";
      }
docs: Converts the legacy {@link CommonAttributes#FILTER filter} to the new {@link CommonAttributes#FILTER_SPEC filter
  spec}.
  
  @param value the value to convert
  
  @return the filter expression (filter spec) or an empty String the value is not
  {@linkplain ModelNode#isDefined() defined}
  
  @throws org.jboss.as.controller.OperationFailedException if a conversion error occurs