io.virtdata.libbasics.shared.from_string.MatchRegexAutoDocsInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of virtdata-lib-realer Show documentation
Show all versions of virtdata-lib-realer Show documentation
With inspiration from other libraries
// This file is auto-generated.
package io.virtdata.libbasics.shared.from_string;
import io.virtdata.annotations.Category;
import io.virtdata.annotations.Service;
import io.virtdata.processors.DocCtorData;
import io.virtdata.processors.DocForFuncCtor;
import io.virtdata.processors.DocFuncData;
import java.lang.String;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
@Service(DocFuncData.class)
public class MatchRegexAutoDocsInfo implements DocFuncData {
public String getClassName() {
return "MatchRegex";
}
public String getPackageName() {
return "io.virtdata.libbasics.shared.from_string";
}
public String getClassJavadoc() {
return "Match any input with a regular expression, and apply the associated\n"
+ "regex replacement to it, yielding the value.\n"
+ "If no matches occur, then the original value is passed through unchanged.\n"
+ "Patterns and replacements are passed as even,odd pairs indexed from the\n"
+ "0th position. Back-references to matching groups are supported.\n"
+ "\n";
}
public String getInType() {
return "java.lang.String";
}
public String getOutType() {
return "java.lang.String";
}
public Category[] getCategories() {
return new Category[] { };
}
public List getCtors() {
return new ArrayList() {{
add(new DocForFuncCtor("MatchRegex", "",
new LinkedHashMap() {{
put("specs","java.lang.String[]...");
}},
new ArrayList>() {{
add(new ArrayList() {{
add("MatchRegex('.*(25|6to4).*','$1')");
add("Match 25 or 6 to 4 and set the output to only that");
}});
add(new ArrayList() {{
add("MatchRegex('([0-9]+)-([0-9]+)-([0-9]+)','$1 $2 $3'");
add("replaced dashes with spaces in a 10 digit US phone number.");
}});
}}
));
}};
}
}