_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q10500 | aaagroup_vpntrafficpolicy_binding.get | train | public static aaagroup_vpntrafficpolicy_binding[] get(nitro_service service, String groupname) throws Exception{
aaagroup_vpntrafficpolicy_binding obj = new aaagroup_vpntrafficpolicy_binding();
obj.set_groupname(groupname);
aaagroup_vpntrafficpolicy_binding response[] = (aaagroup_vpntrafficpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10501 | StringUtils.mapStringToMap | train | public static Map<String, String> mapStringToMap(String map) {
String[] m = map.split("[,;]");
Map<String, String> res = new HashMap<String, String>();
for (String str : m) {
int index = str.lastIndexOf('=');
String key = str.substring(0, index);
String val = str.substring(index + 1);
res.put(key.trim(), val.trim());
}
return res;
} | java | {
"resource": ""
} |
q10502 | StringUtils.pad | train | public static String pad(String str, int totalChars) {
if (str == null) {
str = "null";
}
int slen = str.length();
StringBuilder sb = new StringBuilder(str);
for (int i = 0; i < totalChars - slen; i++) {
sb.append(' ');
}
return sb.toString();
} | java | {
"resource": ""
} |
q10503 | StringUtils.padOrTrim | train | public static String padOrTrim(String str, int num) {
if (str == null) {
str = "null";
}
int leng = str.length();
if (leng < num) {
StringBuilder sb = new StringBuilder(str);
for (int i = 0; i < num - leng; i++) {
sb.append(' ');
}
return sb.toString();
} else if (leng > num) {
return str.substring(0, num);
} else {
return str;
}
} | java | {
"resource": ""
} |
q10504 | StringUtils.padLeft | train | public static String padLeft(String str, int totalChars, char ch) {
if (str == null) {
str = "null";
}
StringBuilder sb = new StringBuilder();
for (int i = 0, num = totalChars - str.length(); i < num; i++) {
sb.append(ch);
}
sb.append(str);
return sb.toString();
} | java | {
"resource": ""
} |
q10505 | StringUtils.trim | train | public static String trim(String s, int maxWidth) {
if (s.length() <= maxWidth) {
return (s);
}
return (s.substring(0, maxWidth));
} | java | {
"resource": ""
} |
q10506 | StringUtils.fileNameClean | train | public static String fileNameClean(String s) {
char[] chars = s.toCharArray();
StringBuilder sb = new StringBuilder();
for (char c : chars) {
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c == '_')) {
sb.append(c);
} else {
if (c == ' ' || c == '-') {
sb.append('_');
} else {
sb.append('x').append((int) c).append('x');
}
}
}
return sb.toString();
} | java | {
"resource": ""
} |
q10507 | StringUtils.truncate | train | public static String truncate(int n, int smallestDigit, int biggestDigit) {
int numDigits = biggestDigit - smallestDigit + 1;
char[] result = new char[numDigits];
for (int j = 1; j < smallestDigit; j++) {
n = n / 10;
}
for (int j = numDigits - 1; j >= 0; j--) {
result[j] = Character.forDigit(n % 10, 10);
n = n / 10;
}
return new String(result);
} | java | {
"resource": ""
} |
q10508 | StringUtils.checkRequiredProperties | train | public static String checkRequiredProperties(Properties props,
String ... requiredProps) {
for (String required : requiredProps) {
if (props.getProperty(required) == null) {
return required;
}
}
return null;
} | java | {
"resource": ""
} |
q10509 | StringUtils.printToFile | train | public static void printToFile(String filename, String message) {
printToFile(new File(filename), message, false);
} | java | {
"resource": ""
} |
q10510 | StringUtils.longestCommonContiguousSubstring | train | public static int longestCommonContiguousSubstring(String s, String t) {
if (s.length() == 0 || t.length() == 0) {
return 0;
}
int M = s.length();
int N = t.length();
int[][] d = new int[M + 1][N + 1];
for (int j = 0; j <= N; j++) {
d[0][j] = 0;
}
for (int i = 0; i <= M; i++) {
d[i][0] = 0;
}
int max = 0;
for (int i = 1; i <= M; i++) {
for (int j = 1; j <= N; j++) {
if (s.charAt(i - 1) == t.charAt(j - 1)) {
d[i][j] = d[i - 1][j - 1] + 1;
} else {
d[i][j] = 0;
}
if (d[i][j] > max) {
max = d[i][j];
}
}
}
// System.err.println("LCCS(" + s + "," + t + ") = " + max);
return max;
} | java | {
"resource": ""
} |
q10511 | StringUtils.pennPOSToWordnetPOS | train | public static String pennPOSToWordnetPOS(String s) {
if (s.matches("NN|NNP|NNS|NNPS")) {
return "noun";
}
if (s.matches("VB|VBD|VBG|VBN|VBZ|VBP|MD")) {
return "verb";
}
if (s.matches("JJ|JJR|JJS|CD")) {
return "adjective";
}
if (s.matches("RB|RBR|RBS|RP|WRB")) {
return "adverb";
}
return null;
} | java | {
"resource": ""
} |
q10512 | StringUtils.getShortClassName | train | public static String getShortClassName(Object o) {
String name = o.getClass().getName();
int index = name.lastIndexOf('.');
if (index >= 0) {
name = name.substring(index + 1);
}
return name;
} | java | {
"resource": ""
} |
q10513 | StringUtils.columnStringToObject | train | public static <T> T columnStringToObject(Class objClass, String str, String delimiterRegex, String[] fieldNames)
throws InstantiationException, IllegalAccessException, NoSuchFieldException, NoSuchMethodException, InvocationTargetException
{
Pattern delimiterPattern = Pattern.compile(delimiterRegex);
return StringUtils.<T>columnStringToObject(objClass, str, delimiterPattern, fieldNames);
} | java | {
"resource": ""
} |
q10514 | StringUtils.columnStringToObject | train | public static <T> T columnStringToObject(Class<?> objClass, String str, Pattern delimiterPattern, String[] fieldNames)
throws InstantiationException, IllegalAccessException, NoSuchMethodException, NoSuchFieldException, InvocationTargetException
{
String[] fields = delimiterPattern.split(str);
T item = ErasureUtils.<T>uncheckedCast(objClass.newInstance());
for (int i = 0; i < fields.length; i++) {
try {
Field field = objClass.getDeclaredField(fieldNames[i]);
field.set(item, fields[i]);
} catch (IllegalAccessException ex) {
Method method = objClass.getDeclaredMethod("set" + StringUtils.capitalize(fieldNames[i]), String.class);
method.invoke(item, fields[i]);
}
}
return item;
} | java | {
"resource": ""
} |
q10515 | StringUtils.objectToColumnString | train | public static String objectToColumnString(Object object, String delimiter, String[] fieldNames)
throws IllegalAccessException, NoSuchFieldException, NoSuchMethodException, InvocationTargetException
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < fieldNames.length; i++) {
if (sb.length() > 0) {
sb.append(delimiter);
}
try {
Field field = object.getClass().getDeclaredField(fieldNames[i]);
sb.append(field.get(object)) ;
} catch (IllegalAccessException ex) {
Method method = object.getClass().getDeclaredMethod("get" + StringUtils.capitalize(fieldNames[i]));
sb.append(method.invoke(object));
}
}
return sb.toString();
} | java | {
"resource": ""
} |
q10516 | StringUtils.makeHTMLTable | train | public static String makeHTMLTable(String[][] table, String[] rowLabels, String[] colLabels) {
StringBuilder buff = new StringBuilder();
buff.append("<table class=\"auto\" border=\"1\" cellspacing=\"0\">\n");
// top row
buff.append("<tr>\n");
buff.append("<td></td>\n"); // the top left cell
for (int j = 0; j < table[0].length; j++) { // assume table is a rectangular matrix
buff.append("<td class=\"label\">").append(colLabels[j]).append("</td>\n");
}
buff.append("</tr>\n");
// all other rows
for (int i = 0; i < table.length; i++) {
// one row
buff.append("<tr>\n");
buff.append("<td class=\"label\">").append(rowLabels[i]).append("</td>\n");
for (int j = 0; j < table[i].length; j++) {
buff.append("<td class=\"data\">");
buff.append(((table[i][j] != null) ? table[i][j] : ""));
buff.append("</td>\n");
}
buff.append("</tr>\n");
}
buff.append("</table>");
return buff.toString();
} | java | {
"resource": ""
} |
q10517 | StringUtils.makeAsciiTable | train | public static String makeAsciiTable(Object[][] table, Object[] rowLabels, Object[] colLabels, int padLeft, int padRight, boolean tsv) {
StringBuilder buff = new StringBuilder();
// top row
buff.append(makeAsciiTableCell("", padLeft, padRight, tsv)); // the top left cell
for (int j = 0; j < table[0].length; j++) { // assume table is a rectangular matrix
buff.append(makeAsciiTableCell(colLabels[j], padLeft, padRight, (j != table[0].length - 1) && tsv));
}
buff.append('\n');
// all other rows
for (int i = 0; i < table.length; i++) {
// one row
buff.append(makeAsciiTableCell(rowLabels[i], padLeft, padRight, tsv));
for (int j = 0; j < table[i].length; j++) {
buff.append(makeAsciiTableCell(table[i][j], padLeft, padRight, (j != table[0].length - 1) && tsv));
}
buff.append('\n');
}
return buff.toString();
} | java | {
"resource": ""
} |
q10518 | StringUtils.makeAsciiTableCell | train | private static String makeAsciiTableCell(Object obj, int padLeft, int padRight, boolean tsv) {
String result = obj.toString();
if (padLeft > 0) {
result = padLeft(result, padLeft);
}
if (padRight > 0) {
result = pad(result, padRight);
}
if (tsv) {
result = result + '\t';
}
return result;
} | java | {
"resource": ""
} |
q10519 | StringUtils.main | train | public static void main(String[] args) {
String[] s = {"there once was a man", "this one is a manic", "hey there", "there once was a mane", "once in a manger.", "where is one match?", "Jo3seph Smarr!", "Joseph R Smarr"};
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
System.out.println("s1: " + s[i]);
System.out.println("s2: " + s[j]);
System.out.println("edit distance: " + editDistance(s[i], s[j]));
System.out.println("LCS: " + longestCommonSubstring(s[i], s[j]));
System.out.println("LCCS: " + longestCommonContiguousSubstring(s[i], s[j]));
System.out.println();
}
}
} | java | {
"resource": ""
} |
q10520 | StringUtils.chomp | train | public static String chomp(String s) {
if(s.length() == 0)
return s;
int l_1 = s.length() - 1;
if (s.charAt(l_1) == '\n') {
return s.substring(0, l_1);
}
return s;
} | java | {
"resource": ""
} |
q10521 | StringUtils.isPunct | train | public static boolean isPunct(String s){
Pattern p = Pattern.compile("^[\\p{Punct}]+$");
Matcher m = p.matcher(s);
return m.matches();
} | java | {
"resource": ""
} |
q10522 | authenticationvserver_auditnslogpolicy_binding.get | train | public static authenticationvserver_auditnslogpolicy_binding[] get(nitro_service service, String name) throws Exception{
authenticationvserver_auditnslogpolicy_binding obj = new authenticationvserver_auditnslogpolicy_binding();
obj.set_name(name);
authenticationvserver_auditnslogpolicy_binding response[] = (authenticationvserver_auditnslogpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10523 | servicegroup_lbmonitor_binding.get | train | public static servicegroup_lbmonitor_binding[] get(nitro_service service, String servicegroupname) throws Exception{
servicegroup_lbmonitor_binding obj = new servicegroup_lbmonitor_binding();
obj.set_servicegroupname(servicegroupname);
servicegroup_lbmonitor_binding response[] = (servicegroup_lbmonitor_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10524 | nstrafficdomain_bridgegroup_binding.get | train | public static nstrafficdomain_bridgegroup_binding[] get(nitro_service service, Long td) throws Exception{
nstrafficdomain_bridgegroup_binding obj = new nstrafficdomain_bridgegroup_binding();
obj.set_td(td);
nstrafficdomain_bridgegroup_binding response[] = (nstrafficdomain_bridgegroup_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10525 | nstrafficdomain_bridgegroup_binding.count | train | public static long count(nitro_service service, Long td) throws Exception{
nstrafficdomain_bridgegroup_binding obj = new nstrafficdomain_bridgegroup_binding();
obj.set_td(td);
options option = new options();
option.set_count(true);
nstrafficdomain_bridgegroup_binding response[] = (nstrafficdomain_bridgegroup_binding[]) obj.get_resources(service,option);
if (response != null) {
return response[0].__count;
}
return 0;
} | java | {
"resource": ""
} |
q10526 | AbstractIntIntMap.toStringByValue | train | public String toStringByValue() {
IntArrayList theKeys = new IntArrayList();
keysSortedByValue(theKeys);
StringBuffer buf = new StringBuffer();
buf.append("[");
int maxIndex = theKeys.size() - 1;
for (int i = 0; i <= maxIndex; i++) {
int key = theKeys.get(i);
buf.append(String.valueOf(key));
buf.append("->");
buf.append(String.valueOf(get(key)));
if (i < maxIndex) buf.append(", ");
}
buf.append("]");
return buf.toString();
} | java | {
"resource": ""
} |
q10527 | scpolicy_stats.get | train | public static scpolicy_stats[] get(nitro_service service) throws Exception{
scpolicy_stats obj = new scpolicy_stats();
scpolicy_stats[] response = (scpolicy_stats[])obj.stat_resources(service);
return response;
} | java | {
"resource": ""
} |
q10528 | scpolicy_stats.get | train | public static scpolicy_stats get(nitro_service service, String name) throws Exception{
scpolicy_stats obj = new scpolicy_stats();
obj.set_name(name);
scpolicy_stats response = (scpolicy_stats) obj.stat_resource(service);
return response;
} | java | {
"resource": ""
} |
q10529 | vpnvserver_vpnsessionpolicy_binding.get | train | public static vpnvserver_vpnsessionpolicy_binding[] get(nitro_service service, String name) throws Exception{
vpnvserver_vpnsessionpolicy_binding obj = new vpnvserver_vpnsessionpolicy_binding();
obj.set_name(name);
vpnvserver_vpnsessionpolicy_binding response[] = (vpnvserver_vpnsessionpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10530 | PrimeFinder.main | train | protected static void main(String args[]) {
int from = Integer.parseInt(args[0]);
int to = Integer.parseInt(args[1]);
statistics(from,to);
} | java | {
"resource": ""
} |
q10531 | PrimeFinder.statistics | train | protected static void statistics(int from, int to) {
// check that primes contain no accidental errors
for (int i=0; i<primeCapacities.length-1; i++) {
if (primeCapacities[i] >= primeCapacities[i+1]) throw new RuntimeException("primes are unsorted or contain duplicates; detected at "+i+"@"+primeCapacities[i]);
}
double accDeviation = 0.0;
double maxDeviation = - 1.0;
for (int i=from; i<=to; i++) {
int primeCapacity = nextPrime(i);
//System.out.println(primeCapacity);
double deviation = (primeCapacity - i) / (double)i;
if (deviation > maxDeviation) {
maxDeviation = deviation;
System.out.println("new maxdev @"+i+"@dev="+maxDeviation);
}
accDeviation += deviation;
}
long width = 1 + (long)to - (long)from;
double meanDeviation = accDeviation/width;
System.out.println("Statistics for ["+ from + ","+to+"] are as follows");
System.out.println("meanDeviation = "+(float)meanDeviation*100+" %");
System.out.println("maxDeviation = "+(float)maxDeviation*100+" %");
} | java | {
"resource": ""
} |
q10532 | Options.readData | train | public void readData(BufferedReader in) throws IOException {
String line, value;
// skip old variables if still present
lexOptions.readData(in);
line = in.readLine();
value = line.substring(line.indexOf(' ') + 1);
try {
tlpParams = (TreebankLangParserParams) Class.forName(value).newInstance();
} catch (Exception e) {
IOException ioe = new IOException("Problem instantiating parserParams: " + line);
ioe.initCause(e);
throw ioe;
}
line = in.readLine();
// ensure backwards compatibility
if (line.matches("^forceCNF.*")) {
value = line.substring(line.indexOf(' ') + 1);
forceCNF = Boolean.parseBoolean(value);
line = in.readLine();
}
value = line.substring(line.indexOf(' ') + 1);
doPCFG = Boolean.parseBoolean(value);
line = in.readLine();
value = line.substring(line.indexOf(' ') + 1);
doDep = Boolean.parseBoolean(value);
line = in.readLine();
value = line.substring(line.indexOf(' ') + 1);
freeDependencies = Boolean.parseBoolean(value);
line = in.readLine();
value = line.substring(line.indexOf(' ') + 1);
directional = Boolean.parseBoolean(value);
line = in.readLine();
value = line.substring(line.indexOf(' ') + 1);
genStop = Boolean.parseBoolean(value);
line = in.readLine();
value = line.substring(line.indexOf(' ') + 1);
distance = Boolean.parseBoolean(value);
line = in.readLine();
value = line.substring(line.indexOf(' ') + 1);
coarseDistance = Boolean.parseBoolean(value);
line = in.readLine();
value = line.substring(line.indexOf(' ') + 1);
dcTags = Boolean.parseBoolean(value);
line = in.readLine();
if ( ! line.matches("^nPrune.*")) {
throw new RuntimeException("Expected nPrune, found: " + line);
}
value = line.substring(line.indexOf(' ') + 1);
nodePrune = Boolean.parseBoolean(value);
line = in.readLine(); // get rid of last line
if (line.length() != 0) {
throw new RuntimeException("Expected blank line, found: " + line);
}
} | java | {
"resource": ""
} |
q10533 | protocolip_stats.get | train | public static protocolip_stats get(nitro_service service) throws Exception{
protocolip_stats obj = new protocolip_stats();
protocolip_stats[] response = (protocolip_stats[])obj.stat_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q10534 | Filters.switchedFilter | train | public static <E> Filter<E> switchedFilter(Filter<E> filter, boolean negated) {
return (new NegatedFilter<E>(filter, negated));
} | java | {
"resource": ""
} |
q10535 | Filters.filter | train | @SuppressWarnings("unchecked")
public static <E> E[] filter(E[] elems, Filter<E> filter) {
List<E> filtered = new ArrayList<E>();
for (E elem: elems) {
if (filter.accept(elem)) {
filtered.add(elem);
}
}
return (filtered.toArray((E[]) Array.newInstance(elems.getClass().getComponentType(), filtered.size())));
} | java | {
"resource": ""
} |
q10536 | Filters.retainAll | train | public static <E> void retainAll(Collection<E> elems, Filter<? super E> filter) {
for (Iterator<E> iter = elems.iterator(); iter.hasNext();) {
E elem = iter.next();
if ( ! filter.accept(elem)) {
iter.remove();
}
}
} | java | {
"resource": ""
} |
q10537 | appflowpolicy_binding.get | train | public static appflowpolicy_binding get(nitro_service service, String name) throws Exception{
appflowpolicy_binding obj = new appflowpolicy_binding();
obj.set_name(name);
appflowpolicy_binding response = (appflowpolicy_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10538 | hanode_routemonitor_binding.get | train | public static hanode_routemonitor_binding[] get(nitro_service service, Long id) throws Exception{
hanode_routemonitor_binding obj = new hanode_routemonitor_binding();
obj.set_id(id);
hanode_routemonitor_binding response[] = (hanode_routemonitor_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10539 | dnsview.add | train | public static base_response add(nitro_service client, dnsview resource) throws Exception {
dnsview addresource = new dnsview();
addresource.viewname = resource.viewname;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q10540 | dnsview.add | train | public static base_responses add(nitro_service client, dnsview resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
dnsview addresources[] = new dnsview[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new dnsview();
addresources[i].viewname = resources[i].viewname;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q10541 | dnsview.delete | train | public static base_response delete(nitro_service client, String viewname) throws Exception {
dnsview deleteresource = new dnsview();
deleteresource.viewname = viewname;
return deleteresource.delete_resource(client);
} | java | {
"resource": ""
} |
q10542 | dnsview.get | train | public static dnsview[] get(nitro_service service) throws Exception{
dnsview obj = new dnsview();
dnsview[] response = (dnsview[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10543 | dnsview.get | train | public static dnsview get(nitro_service service, String viewname) throws Exception{
dnsview obj = new dnsview();
obj.set_viewname(viewname);
dnsview response = (dnsview) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10544 | dnsview.get | train | public static dnsview[] get(nitro_service service, String viewname[]) throws Exception{
if (viewname !=null && viewname.length>0) {
dnsview response[] = new dnsview[viewname.length];
dnsview obj[] = new dnsview[viewname.length];
for (int i=0;i<viewname.length;i++) {
obj[i] = new dnsview();
obj[i].set_viewname(viewname[i]);
response[i] = (dnsview) obj[i].get_resource(service);
}
return response;
}
return null;
} | java | {
"resource": ""
} |
q10545 | onlinkipv6prefix.add | train | public static base_response add(nitro_service client, onlinkipv6prefix resource) throws Exception {
onlinkipv6prefix addresource = new onlinkipv6prefix();
addresource.ipv6prefix = resource.ipv6prefix;
addresource.onlinkprefix = resource.onlinkprefix;
addresource.autonomusprefix = resource.autonomusprefix;
addresource.depricateprefix = resource.depricateprefix;
addresource.decrementprefixlifetimes = resource.decrementprefixlifetimes;
addresource.prefixvalidelifetime = resource.prefixvalidelifetime;
addresource.prefixpreferredlifetime = resource.prefixpreferredlifetime;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q10546 | onlinkipv6prefix.add | train | public static base_responses add(nitro_service client, onlinkipv6prefix resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
onlinkipv6prefix addresources[] = new onlinkipv6prefix[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new onlinkipv6prefix();
addresources[i].ipv6prefix = resources[i].ipv6prefix;
addresources[i].onlinkprefix = resources[i].onlinkprefix;
addresources[i].autonomusprefix = resources[i].autonomusprefix;
addresources[i].depricateprefix = resources[i].depricateprefix;
addresources[i].decrementprefixlifetimes = resources[i].decrementprefixlifetimes;
addresources[i].prefixvalidelifetime = resources[i].prefixvalidelifetime;
addresources[i].prefixpreferredlifetime = resources[i].prefixpreferredlifetime;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q10547 | onlinkipv6prefix.delete | train | public static base_response delete(nitro_service client, String ipv6prefix) throws Exception {
onlinkipv6prefix deleteresource = new onlinkipv6prefix();
deleteresource.ipv6prefix = ipv6prefix;
return deleteresource.delete_resource(client);
} | java | {
"resource": ""
} |
q10548 | onlinkipv6prefix.update | train | public static base_response update(nitro_service client, onlinkipv6prefix resource) throws Exception {
onlinkipv6prefix updateresource = new onlinkipv6prefix();
updateresource.ipv6prefix = resource.ipv6prefix;
updateresource.onlinkprefix = resource.onlinkprefix;
updateresource.autonomusprefix = resource.autonomusprefix;
updateresource.depricateprefix = resource.depricateprefix;
updateresource.decrementprefixlifetimes = resource.decrementprefixlifetimes;
updateresource.prefixvalidelifetime = resource.prefixvalidelifetime;
updateresource.prefixpreferredlifetime = resource.prefixpreferredlifetime;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q10549 | onlinkipv6prefix.update | train | public static base_responses update(nitro_service client, onlinkipv6prefix resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
onlinkipv6prefix updateresources[] = new onlinkipv6prefix[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new onlinkipv6prefix();
updateresources[i].ipv6prefix = resources[i].ipv6prefix;
updateresources[i].onlinkprefix = resources[i].onlinkprefix;
updateresources[i].autonomusprefix = resources[i].autonomusprefix;
updateresources[i].depricateprefix = resources[i].depricateprefix;
updateresources[i].decrementprefixlifetimes = resources[i].decrementprefixlifetimes;
updateresources[i].prefixvalidelifetime = resources[i].prefixvalidelifetime;
updateresources[i].prefixpreferredlifetime = resources[i].prefixpreferredlifetime;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | {
"resource": ""
} |
q10550 | onlinkipv6prefix.unset | train | public static base_response unset(nitro_service client, onlinkipv6prefix resource, String[] args) throws Exception{
onlinkipv6prefix unsetresource = new onlinkipv6prefix();
unsetresource.ipv6prefix = resource.ipv6prefix;
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q10551 | onlinkipv6prefix.unset | train | public static base_responses unset(nitro_service client, onlinkipv6prefix resources[], String[] args) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
onlinkipv6prefix unsetresources[] = new onlinkipv6prefix[resources.length];
for (int i=0;i<resources.length;i++){
unsetresources[i] = new onlinkipv6prefix();
unsetresources[i].ipv6prefix = resources[i].ipv6prefix;
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java | {
"resource": ""
} |
q10552 | onlinkipv6prefix.get | train | public static onlinkipv6prefix[] get(nitro_service service) throws Exception{
onlinkipv6prefix obj = new onlinkipv6prefix();
onlinkipv6prefix[] response = (onlinkipv6prefix[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10553 | onlinkipv6prefix.get | train | public static onlinkipv6prefix get(nitro_service service, String ipv6prefix) throws Exception{
onlinkipv6prefix obj = new onlinkipv6prefix();
obj.set_ipv6prefix(ipv6prefix);
onlinkipv6prefix response = (onlinkipv6prefix) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10554 | onlinkipv6prefix.get | train | public static onlinkipv6prefix[] get(nitro_service service, String ipv6prefix[]) throws Exception{
if (ipv6prefix !=null && ipv6prefix.length>0) {
onlinkipv6prefix response[] = new onlinkipv6prefix[ipv6prefix.length];
onlinkipv6prefix obj[] = new onlinkipv6prefix[ipv6prefix.length];
for (int i=0;i<ipv6prefix.length;i++) {
obj[i] = new onlinkipv6prefix();
obj[i].set_ipv6prefix(ipv6prefix[i]);
response[i] = (onlinkipv6prefix) obj[i].get_resource(service);
}
return response;
}
return null;
} | java | {
"resource": ""
} |
q10555 | vpnsessionpolicy_aaauser_binding.get | train | public static vpnsessionpolicy_aaauser_binding[] get(nitro_service service, String name) throws Exception{
vpnsessionpolicy_aaauser_binding obj = new vpnsessionpolicy_aaauser_binding();
obj.set_name(name);
vpnsessionpolicy_aaauser_binding response[] = (vpnsessionpolicy_aaauser_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10556 | vpnvserver_authenticationradiuspolicy_binding.get | train | public static vpnvserver_authenticationradiuspolicy_binding[] get(nitro_service service, String name) throws Exception{
vpnvserver_authenticationradiuspolicy_binding obj = new vpnvserver_authenticationradiuspolicy_binding();
obj.set_name(name);
vpnvserver_authenticationradiuspolicy_binding response[] = (vpnvserver_authenticationradiuspolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10557 | aaa_stats.get | train | public static aaa_stats get(nitro_service service) throws Exception{
aaa_stats obj = new aaa_stats();
aaa_stats[] response = (aaa_stats[])obj.stat_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q10558 | aaagroup_aaauser_binding.get | train | public static aaagroup_aaauser_binding[] get(nitro_service service, String groupname) throws Exception{
aaagroup_aaauser_binding obj = new aaagroup_aaauser_binding();
obj.set_groupname(groupname);
aaagroup_aaauser_binding response[] = (aaagroup_aaauser_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10559 | lbvserver.get | train | public static lbvserver[] get(nitro_service service) throws Exception{
lbvserver obj = new lbvserver();
lbvserver[] response = (lbvserver[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10560 | lbvserver.get | train | public static lbvserver get(nitro_service service, String name) throws Exception{
lbvserver obj = new lbvserver();
obj.set_name(name);
lbvserver response = (lbvserver) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10561 | lbvserver.get_filtered | train | public static lbvserver[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{
lbvserver obj = new lbvserver();
options option = new options();
option.set_filter(filter);
lbvserver[] response = (lbvserver[]) obj.getfiltered(service, option);
return response;
} | java | {
"resource": ""
} |
q10562 | csvserver_cspolicy_binding.get | train | public static csvserver_cspolicy_binding[] get(nitro_service service, String name) throws Exception{
csvserver_cspolicy_binding obj = new csvserver_cspolicy_binding();
obj.set_name(name);
csvserver_cspolicy_binding response[] = (csvserver_cspolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10563 | sslservicegroup_sslcertkey_binding.get | train | public static sslservicegroup_sslcertkey_binding[] get(nitro_service service, String servicegroupname) throws Exception{
sslservicegroup_sslcertkey_binding obj = new sslservicegroup_sslcertkey_binding();
obj.set_servicegroupname(servicegroupname);
sslservicegroup_sslcertkey_binding response[] = (sslservicegroup_sslcertkey_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10564 | application.Import | train | public static base_response Import(nitro_service client, application resource) throws Exception {
application Importresource = new application();
Importresource.apptemplatefilename = resource.apptemplatefilename;
Importresource.appname = resource.appname;
Importresource.deploymentfilename = resource.deploymentfilename;
return Importresource.perform_operation(client,"Import");
} | java | {
"resource": ""
} |
q10565 | application.export | train | public static base_response export(nitro_service client, application resource) throws Exception {
application exportresource = new application();
exportresource.appname = resource.appname;
exportresource.apptemplatefilename = resource.apptemplatefilename;
exportresource.deploymentfilename = resource.deploymentfilename;
return exportresource.perform_operation(client,"export");
} | java | {
"resource": ""
} |
q10566 | application.delete | train | public static base_response delete(nitro_service client, application resource) throws Exception {
application deleteresource = new application();
deleteresource.appname = resource.appname;
return deleteresource.delete_resource(client);
} | java | {
"resource": ""
} |
q10567 | vpnglobal_binding.get | train | public static vpnglobal_binding get(nitro_service service) throws Exception{
vpnglobal_binding obj = new vpnglobal_binding();
vpnglobal_binding response = (vpnglobal_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10568 | authenticationtacacspolicy_systemglobal_binding.get | train | public static authenticationtacacspolicy_systemglobal_binding[] get(nitro_service service, String name) throws Exception{
authenticationtacacspolicy_systemglobal_binding obj = new authenticationtacacspolicy_systemglobal_binding();
obj.set_name(name);
authenticationtacacspolicy_systemglobal_binding response[] = (authenticationtacacspolicy_systemglobal_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10569 | cmpparameter.update | train | public static base_response update(nitro_service client, cmpparameter resource) throws Exception {
cmpparameter updateresource = new cmpparameter();
updateresource.cmplevel = resource.cmplevel;
updateresource.quantumsize = resource.quantumsize;
updateresource.servercmp = resource.servercmp;
updateresource.heurexpiry = resource.heurexpiry;
updateresource.heurexpirythres = resource.heurexpirythres;
updateresource.heurexpiryhistwt = resource.heurexpiryhistwt;
updateresource.minressize = resource.minressize;
updateresource.cmpbypasspct = resource.cmpbypasspct;
updateresource.cmponpush = resource.cmponpush;
updateresource.policytype = resource.policytype;
updateresource.addvaryheader = resource.addvaryheader;
updateresource.externalcache = resource.externalcache;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q10570 | cmpparameter.unset | train | public static base_response unset(nitro_service client, cmpparameter resource, String[] args) throws Exception{
cmpparameter unsetresource = new cmpparameter();
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q10571 | cmpparameter.get | train | public static cmpparameter get(nitro_service service) throws Exception{
cmpparameter obj = new cmpparameter();
cmpparameter[] response = (cmpparameter[])obj.get_resources(service);
return response[0];
} | java | {
"resource": ""
} |
q10572 | cmpglobal_cmppolicy_binding.get | train | public static cmpglobal_cmppolicy_binding[] get(nitro_service service) throws Exception{
cmpglobal_cmppolicy_binding obj = new cmpglobal_cmppolicy_binding();
cmpglobal_cmppolicy_binding response[] = (cmpglobal_cmppolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10573 | sslcertkey_crldistribution_binding.get | train | public static sslcertkey_crldistribution_binding[] get(nitro_service service, String certkey) throws Exception{
sslcertkey_crldistribution_binding obj = new sslcertkey_crldistribution_binding();
obj.set_certkey(certkey);
sslcertkey_crldistribution_binding response[] = (sslcertkey_crldistribution_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10574 | sslcertkey_crldistribution_binding.count | train | public static long count(nitro_service service, String certkey) throws Exception{
sslcertkey_crldistribution_binding obj = new sslcertkey_crldistribution_binding();
obj.set_certkey(certkey);
options option = new options();
option.set_count(true);
sslcertkey_crldistribution_binding response[] = (sslcertkey_crldistribution_binding[]) obj.get_resources(service,option);
if (response != null) {
return response[0].__count;
}
return 0;
} | java | {
"resource": ""
} |
q10575 | clustersync.Force | train | public static base_response Force(nitro_service client, clustersync resource) throws Exception {
clustersync Forceresource = new clustersync();
return Forceresource.perform_operation(client,"Force");
} | java | {
"resource": ""
} |
q10576 | RestAdapter.computePagedList | train | private List<T> computePagedList(List<T> result, HeaderAndBody httpResponse, JSONObject where, Pipe<T> requestingPipe) {
ReadFilter previousRead = null;
ReadFilter nextRead = null;
if (PageConfig.MetadataLocations.WEB_LINKING.equals(pageConfig.getMetadataLocation())) {
String webLinksRaw = "";
final String relHeader = "rel";
final String nextIdentifier = pageConfig.getNextIdentifier();
final String prevIdentifier = pageConfig.getPreviousIdentifier();
try {
webLinksRaw = getWebLinkHeader(httpResponse);
if (webLinksRaw == null) { // no paging, return result
return result;
}
List<WebLink> webLinksParsed = WebLinkParser.parse(webLinksRaw);
for (WebLink link : webLinksParsed) {
if (nextIdentifier.equals(link.getParameters().get(relHeader))) {
nextRead = new ReadFilter();
nextRead.setLinkUri(new URI(link.getUri()));
} else if (prevIdentifier.equals(link.getParameters().get(relHeader))) {
previousRead = new ReadFilter();
previousRead.setLinkUri(new URI(link.getUri()));
}
}
} catch (URISyntaxException ex) {
Log.e(TAG, webLinksRaw + " did not contain a valid context URI", ex);
throw new RuntimeException(ex);
} catch (ParseException ex) {
Log.e(TAG, webLinksRaw + " could not be parsed as a web link header", ex);
throw new RuntimeException(ex);
}
} else if (pageConfig.getMetadataLocation().equals(PageConfig.MetadataLocations.HEADERS)) {
nextRead = pageConfig.getPageParameterExtractor().getNextFilter(httpResponse, RestAdapter.this.pageConfig);
previousRead = pageConfig.getPageParameterExtractor().getPreviousFilter(httpResponse, RestAdapter.this.pageConfig);
} else if (pageConfig.getMetadataLocation().equals(PageConfig.MetadataLocations.BODY)) {
nextRead = pageConfig.getPageParameterExtractor().getNextFilter(httpResponse, RestAdapter.this.pageConfig);
previousRead = pageConfig.getPageParameterExtractor().getPreviousFilter(httpResponse, RestAdapter.this.pageConfig);
} else {
throw new IllegalStateException("Not supported");
}
if (nextRead != null) {
nextRead.setWhere(where);
}
if (previousRead != null) {
previousRead.setWhere(where);
}
return new WrappingPagedList<T>(requestingPipe, result, nextRead, previousRead);
} | java | {
"resource": ""
} |
q10577 | ipset_nsip6_binding.get | train | public static ipset_nsip6_binding[] get(nitro_service service, String name) throws Exception{
ipset_nsip6_binding obj = new ipset_nsip6_binding();
obj.set_name(name);
ipset_nsip6_binding response[] = (ipset_nsip6_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10578 | nstimer_binding.get | train | public static nstimer_binding get(nitro_service service, String name) throws Exception{
nstimer_binding obj = new nstimer_binding();
obj.set_name(name);
nstimer_binding response = (nstimer_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10579 | responderpolicylabel_binding.get | train | public static responderpolicylabel_binding get(nitro_service service, String labelname) throws Exception{
responderpolicylabel_binding obj = new responderpolicylabel_binding();
obj.set_labelname(labelname);
responderpolicylabel_binding response = (responderpolicylabel_binding) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10580 | filterglobal_filterpolicy_binding.get | train | public static filterglobal_filterpolicy_binding[] get(nitro_service service) throws Exception{
filterglobal_filterpolicy_binding obj = new filterglobal_filterpolicy_binding();
filterglobal_filterpolicy_binding response[] = (filterglobal_filterpolicy_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10581 | streamidentifier_stats.get | train | public static streamidentifier_stats get(nitro_service service, String name) throws Exception{
streamidentifier_stats obj = new streamidentifier_stats();
obj.set_name(name);
streamidentifier_stats response = (streamidentifier_stats) obj.stat_resource(service);
return response;
} | java | {
"resource": ""
} |
q10582 | configstatus.get | train | public static configstatus[] get(nitro_service service) throws Exception{
configstatus obj = new configstatus();
configstatus[] response = (configstatus[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10583 | dnspolicylabel.add | train | public static base_response add(nitro_service client, dnspolicylabel resource) throws Exception {
dnspolicylabel addresource = new dnspolicylabel();
addresource.labelname = resource.labelname;
addresource.transform = resource.transform;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q10584 | dnspolicylabel.add | train | public static base_responses add(nitro_service client, dnspolicylabel resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
dnspolicylabel addresources[] = new dnspolicylabel[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new dnspolicylabel();
addresources[i].labelname = resources[i].labelname;
addresources[i].transform = resources[i].transform;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q10585 | dnspolicylabel.delete | train | public static base_response delete(nitro_service client, String labelname) throws Exception {
dnspolicylabel deleteresource = new dnspolicylabel();
deleteresource.labelname = labelname;
return deleteresource.delete_resource(client);
} | java | {
"resource": ""
} |
q10586 | dnspolicylabel.get | train | public static dnspolicylabel[] get(nitro_service service) throws Exception{
dnspolicylabel obj = new dnspolicylabel();
dnspolicylabel[] response = (dnspolicylabel[])obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10587 | dnspolicylabel.get | train | public static dnspolicylabel get(nitro_service service, String labelname) throws Exception{
dnspolicylabel obj = new dnspolicylabel();
obj.set_labelname(labelname);
dnspolicylabel response = (dnspolicylabel) obj.get_resource(service);
return response;
} | java | {
"resource": ""
} |
q10588 | auditsyslogpolicy_systemglobal_binding.get | train | public static auditsyslogpolicy_systemglobal_binding[] get(nitro_service service, String name) throws Exception{
auditsyslogpolicy_systemglobal_binding obj = new auditsyslogpolicy_systemglobal_binding();
obj.set_name(name);
auditsyslogpolicy_systemglobal_binding response[] = (auditsyslogpolicy_systemglobal_binding[]) obj.get_resources(service);
return response;
} | java | {
"resource": ""
} |
q10589 | sslcertkey.add | train | public static base_response add(nitro_service client, sslcertkey resource) throws Exception {
sslcertkey addresource = new sslcertkey();
addresource.certkey = resource.certkey;
addresource.cert = resource.cert;
addresource.key = resource.key;
addresource.password = resource.password;
addresource.fipskey = resource.fipskey;
addresource.inform = resource.inform;
addresource.passplain = resource.passplain;
addresource.expirymonitor = resource.expirymonitor;
addresource.notificationperiod = resource.notificationperiod;
addresource.bundle = resource.bundle;
return addresource.add_resource(client);
} | java | {
"resource": ""
} |
q10590 | sslcertkey.add | train | public static base_responses add(nitro_service client, sslcertkey resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
sslcertkey addresources[] = new sslcertkey[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new sslcertkey();
addresources[i].certkey = resources[i].certkey;
addresources[i].cert = resources[i].cert;
addresources[i].key = resources[i].key;
addresources[i].password = resources[i].password;
addresources[i].fipskey = resources[i].fipskey;
addresources[i].inform = resources[i].inform;
addresources[i].passplain = resources[i].passplain;
addresources[i].expirymonitor = resources[i].expirymonitor;
addresources[i].notificationperiod = resources[i].notificationperiod;
addresources[i].bundle = resources[i].bundle;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java | {
"resource": ""
} |
q10591 | sslcertkey.delete | train | public static base_response delete(nitro_service client, sslcertkey resource) throws Exception {
sslcertkey deleteresource = new sslcertkey();
deleteresource.certkey = resource.certkey;
return deleteresource.delete_resource(client);
} | java | {
"resource": ""
} |
q10592 | sslcertkey.delete | train | public static base_responses delete(nitro_service client, String certkey[]) throws Exception {
base_responses result = null;
if (certkey != null && certkey.length > 0) {
sslcertkey deleteresources[] = new sslcertkey[certkey.length];
for (int i=0;i<certkey.length;i++){
deleteresources[i] = new sslcertkey();
deleteresources[i].certkey = certkey[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java | {
"resource": ""
} |
q10593 | sslcertkey.update | train | public static base_response update(nitro_service client, sslcertkey resource) throws Exception {
sslcertkey updateresource = new sslcertkey();
updateresource.certkey = resource.certkey;
updateresource.expirymonitor = resource.expirymonitor;
updateresource.notificationperiod = resource.notificationperiod;
return updateresource.update_resource(client);
} | java | {
"resource": ""
} |
q10594 | sslcertkey.update | train | public static base_responses update(nitro_service client, sslcertkey resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
sslcertkey updateresources[] = new sslcertkey[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new sslcertkey();
updateresources[i].certkey = resources[i].certkey;
updateresources[i].expirymonitor = resources[i].expirymonitor;
updateresources[i].notificationperiod = resources[i].notificationperiod;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java | {
"resource": ""
} |
q10595 | sslcertkey.unset | train | public static base_response unset(nitro_service client, sslcertkey resource, String[] args) throws Exception{
sslcertkey unsetresource = new sslcertkey();
unsetresource.certkey = resource.certkey;
return unsetresource.unset_resource(client,args);
} | java | {
"resource": ""
} |
q10596 | sslcertkey.unset | train | public static base_responses unset(nitro_service client, String certkey[], String args[]) throws Exception {
base_responses result = null;
if (certkey != null && certkey.length > 0) {
sslcertkey unsetresources[] = new sslcertkey[certkey.length];
for (int i=0;i<certkey.length;i++){
unsetresources[i] = new sslcertkey();
unsetresources[i].certkey = certkey[i];
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java | {
"resource": ""
} |
q10597 | sslcertkey.link | train | public static base_response link(nitro_service client, sslcertkey resource) throws Exception {
sslcertkey linkresource = new sslcertkey();
linkresource.certkey = resource.certkey;
linkresource.linkcertkeyname = resource.linkcertkeyname;
return linkresource.perform_operation(client,"link");
} | java | {
"resource": ""
} |
q10598 | sslcertkey.link | train | public static base_responses link(nitro_service client, sslcertkey resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
sslcertkey linkresources[] = new sslcertkey[resources.length];
for (int i=0;i<resources.length;i++){
linkresources[i] = new sslcertkey();
linkresources[i].certkey = resources[i].certkey;
linkresources[i].linkcertkeyname = resources[i].linkcertkeyname;
}
result = perform_operation_bulk_request(client, linkresources,"link");
}
return result;
} | java | {
"resource": ""
} |
q10599 | sslcertkey.unlink | train | public static base_response unlink(nitro_service client, sslcertkey resource) throws Exception {
sslcertkey unlinkresource = new sslcertkey();
unlinkresource.certkey = resource.certkey;
return unlinkresource.perform_operation(client,"unlink");
} | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.