@Override
    protected void rdataFromString(Tokenizer st, Name origin) throws IOException {
        svcPriority = st.getUInt16();
        targetName = st.getName(origin);
        svcParams.clear();
        while (true) {
            String keyStr = null;
            String valueStr = null;
            Tokenizer.Token t = st.get();
            if (!t.isString()) {
                break;
            }
            int indexOfEquals = t.value.indexOf('=');
            if (indexOfEquals == -1) {
                // No "=" is key with no value case, leave value string as null
                keyStr = t.value;
            } else if (indexOfEquals == t.value.length() - 1) {
                // Ends with "=" means the next token is quoted string with the value
                keyStr = t.value.substring(0, indexOfEquals);
                Tokenizer.Token valueToken = st.get();
                if (!valueToken.isString()) {
                    throw new TextParseException("Expected value for parameter key '" + keyStr + "'");
                }
                valueStr = valueToken.value;
            } else if (indexOfEquals > 0) {
                // If "=" is in the middle then need to split the key and value from this token
                keyStr = t.value.substring(0, indexOfEquals);
                valueStr = t.value.substring(indexOfEquals + 1);
            } else {
                throw new TextParseException("Expected valid parameter key=value for '" + t.value + "'");
            }

            ParameterBase param;
            int key = parameters.getValue(keyStr);
            if (key == -1) {
                throw new TextParseException("Expected a valid parameter key for '" + keyStr + "'");
            }
            if (svcParams.containsKey(key)) {
                throw new TextParseException("Duplicate parameter key for '" + keyStr + "'");
            }
            Supplier<ParameterBase> factory = parameters.getFactory(key);
            if (factory != null) {
                param = factory.get();
            } else {
                param = new ParameterUnknown(key);
            }
            param.fromString(valueStr);
            svcParams.put(key, param);
        }

        if (svcPriority > 0 && svcParams.isEmpty()) {
            throw new TextParseException(
                    "At least one parameter value must be specified for ServiceMode");
        }
        if (svcPriority == 0 && !svcParams.isEmpty()) {
            throw new TextParseException("No parameter values allowed for AliasMode");
        }
        if (!checkMandatoryParams()) {
            throw new TextParseException("Not all mandatory SvcParams are specified");
        }
    }
Implements common functionality for SVCB and HTTPS records
src/main/java/core/org/xbill/DNS/SVCBBase.java