@Test public void extractTextWithIsRewrite() { Parameters parameters = new Parameters(); parameters.set("text", "is:foo"); String text = underTest.extractText(parameters); assertThat(text, is("assets.attributes.npm.tagged_is:foo")); }
public String extractText(final Parameters parameters) { String textParameter = Strings.nullToEmpty(parameters.get("text")).trim(); if (!textParameter.isEmpty()) { textParameter = textParameter .replaceAll("keywords:", "assets.attributes.npm.keywords:") .replaceAll("author:", "assets.attributes.npm.author:") .replaceAll("maintainer:", "assets.attributes.npm.author:") .replaceAll("is:", "assets.attributes.npm.tagged_is:") .replaceAll("not:", "assets.attributes.npm.tagged_not:") .replaceAll("scope:", "assets.attributes.npm.scope:"); if (!textParameter.contains(":")) { textParameter = WILDCARD + textParameter + WILDCARD; } } return textParameter; }
NpmSearchParameterExtractor extends ComponentSupport { public String extractText(final Parameters parameters) { String textParameter = Strings.nullToEmpty(parameters.get("text")).trim(); if (!textParameter.isEmpty()) { textParameter = textParameter .replaceAll("keywords:", "assets.attributes.npm.keywords:") .replaceAll("author:", "assets.attributes.npm.author:") .replaceAll("maintainer:", "assets.attributes.npm.author:") .replaceAll("is:", "assets.attributes.npm.tagged_is:") .replaceAll("not:", "assets.attributes.npm.tagged_not:") .replaceAll("scope:", "assets.attributes.npm.scope:"); if (!textParameter.contains(":")) { textParameter = WILDCARD + textParameter + WILDCARD; } } return textParameter; } }
NpmSearchParameterExtractor extends ComponentSupport { public String extractText(final Parameters parameters) { String textParameter = Strings.nullToEmpty(parameters.get("text")).trim(); if (!textParameter.isEmpty()) { textParameter = textParameter .replaceAll("keywords:", "assets.attributes.npm.keywords:") .replaceAll("author:", "assets.attributes.npm.author:") .replaceAll("maintainer:", "assets.attributes.npm.author:") .replaceAll("is:", "assets.attributes.npm.tagged_is:") .replaceAll("not:", "assets.attributes.npm.tagged_not:") .replaceAll("scope:", "assets.attributes.npm.scope:"); if (!textParameter.contains(":")) { textParameter = WILDCARD + textParameter + WILDCARD; } } return textParameter; }  }
NpmSearchParameterExtractor extends ComponentSupport { public String extractText(final Parameters parameters) { String textParameter = Strings.nullToEmpty(parameters.get("text")).trim(); if (!textParameter.isEmpty()) { textParameter = textParameter .replaceAll("keywords:", "assets.attributes.npm.keywords:") .replaceAll("author:", "assets.attributes.npm.author:") .replaceAll("maintainer:", "assets.attributes.npm.author:") .replaceAll("is:", "assets.attributes.npm.tagged_is:") .replaceAll("not:", "assets.attributes.npm.tagged_not:") .replaceAll("scope:", "assets.attributes.npm.scope:"); if (!textParameter.contains(":")) { textParameter = WILDCARD + textParameter + WILDCARD; } } return textParameter; }  String extractText(final Parameters parameters); int extractSize(final Parameters parameters); int extractFrom(final Parameters parameters); }
NpmSearchParameterExtractor extends ComponentSupport { public String extractText(final Parameters parameters) { String textParameter = Strings.nullToEmpty(parameters.get("text")).trim(); if (!textParameter.isEmpty()) { textParameter = textParameter .replaceAll("keywords:", "assets.attributes.npm.keywords:") .replaceAll("author:", "assets.attributes.npm.author:") .replaceAll("maintainer:", "assets.attributes.npm.author:") .replaceAll("is:", "assets.attributes.npm.tagged_is:") .replaceAll("not:", "assets.attributes.npm.tagged_not:") .replaceAll("scope:", "assets.attributes.npm.scope:"); if (!textParameter.contains(":")) { textParameter = WILDCARD + textParameter + WILDCARD; } } return textParameter; }  String extractText(final Parameters parameters); int extractSize(final Parameters parameters); int extractFrom(final Parameters parameters);  }