/** * @param pmml PMML model to add extension to, with no content. It may possibly duplicate * existing extensions. * @param key extension key * @param value extension value */ public static void addExtension(PMML pmml, String key, Object value) { pmml.addExtensions(new Extension().setName(key).setValue(value.toString())); }
/** * @param pmml PMML model to add extension to, with a single {@code String} content and no value. * The content is encoded as if they were being added to a PMML {@link Array} and are * space-separated with PMML quoting rules * @param key extension key * @param content list of values to add as a {@code String} */ public static void addExtensionContent(PMML pmml, String key, Collection<?> content) { if (content.isEmpty()) { return; } String joined = TextUtils.joinPMMLDelimited(content); pmml.addExtensions(new Extension().setName(key).addContent(joined)); }
/** * @param pmml PMML model to add extension to, with no content. It may possibly duplicate * existing extensions. * @param key extension key * @param value extension value */ public static void addExtension(PMML pmml, String key, Object value) { pmml.addExtensions(new Extension().setName(key).setValue(value.toString())); }
/** * @param pmml PMML model to add extension to, with a single {@code String} content and no value. * The content is encoded as if they were being added to a PMML {@link Array} and are * space-separated with PMML quoting rules * @param key extension key * @param content list of values to add as a {@code String} */ public static void addExtensionContent(PMML pmml, String key, Collection<?> content) { if (content.isEmpty()) { return; } String joined = TextUtils.joinPMMLDelimited(content); pmml.addExtensions(new Extension().setName(key).addContent(joined)); }