Code review comment: @manuranga Do we have other construct to create StringValue or is it ok to use this directly?

Code under review:
public static Object bindDataToIntendedType(byte[] data, BType intendedType) {
        int dataParamTypeTag = intendedType.getTag();
        Object dispatchedData;
        switch (dataParamTypeTag) {
            case TypeTags.STRING_TAG:
                dispatchedData = new BmpStringValue(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.JSON_TAG:
                try {
                    Object json = JSONParser.parse(new String(data, StandardCharsets.UTF_8));
                    dispatchedData = json instanceof String ? new BmpStringValue((String) json) : json;
                } catch (BallerinaException e) {
                    throw createNatsError("Error occurred in converting message content to json: " +
                            e.getMessage());
                }
                break;
            case TypeTags.INT_TAG:
                dispatchedData = Integer.valueOf(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.BOOLEAN_TAG:
                dispatchedData = Boolean.valueOf(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.FLOAT_TAG:
                dispatchedData = Double.valueOf(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.DECIMAL_TAG:
                dispatchedData = new DecimalValue(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.ARRAY_TAG:
                dispatchedData = new ArrayValueImpl(data);
                break;
            case TypeTags.XML_TAG:
                dispatchedData = XMLFactory.parse(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.RECORD_TYPE_TAG:
                dispatchedData = JSONUtils.convertJSONToRecord(JSONParser.parse(new String(data,
                        StandardCharsets.UTF_8)), (BRecordType) intendedType);
                break;
            default:
                throw Utils.createNatsError("Unable to find a supported data type to bind the message data");
        }
        return dispatchedData;
    }

Line commented on: dispatchedData = new BmpStringValue(new String(data, StandardCharsets.UTF_8));

Revised code:
public static Object bindDataToIntendedType(byte[] data, BType intendedType) {
        int dataParamTypeTag = intendedType.getTag();
        Object dispatchedData;
        switch (dataParamTypeTag) {
            case TypeTags.STRING_TAG:
                dispatchedData = StringUtils.fromString(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.JSON_TAG:
                try {
                    Object json = JSONParser.parse(new String(data, StandardCharsets.UTF_8));
                    dispatchedData = json instanceof String ? StringUtils.fromString((String) json) : json;
                } catch (BallerinaException e) {
                    throw createNatsError("Error occurred in converting message content to json: " +
                            e.getMessage());
                }
                break;
            case TypeTags.INT_TAG:
                dispatchedData = Integer.valueOf(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.BOOLEAN_TAG:
                dispatchedData = Boolean.valueOf(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.FLOAT_TAG:
                dispatchedData = Double.valueOf(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.DECIMAL_TAG:
                dispatchedData = new DecimalValue(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.ARRAY_TAG:
                dispatchedData = new ArrayValueImpl(data);
                break;
            case TypeTags.XML_TAG:
                dispatchedData = XMLFactory.parse(new String(data, StandardCharsets.UTF_8));
                break;
            case TypeTags.RECORD_TYPE_TAG:
                dispatchedData = JSONUtils.convertJSONToRecord(JSONParser.parse(new String(data,
                        StandardCharsets.UTF_8)), (BRecordType) intendedType);
                break;
            default:
                throw Utils.createNatsError("Unable to find a supported data type to bind the message data");
        }
        return dispatchedData;
    }