code
stringlengths
73
34.1k
label
stringclasses
1 value
public static base_response enable(nitro_service client, String acl6name) throws Exception { nsacl6 enableresource = new nsacl6(); enableresource.acl6name = acl6name; return enableresource.perform_operation(client,"enable"); }
java
public static base_responses enable(nitro_service client, String acl6name[]) throws Exception { base_responses result = null; if (acl6name != null && acl6name.length > 0) { nsacl6 enableresources[] = new nsacl6[acl6name.length]; for (int i=0;i<acl6name.length;i++){ enableresources[i] = new nsacl6(); e...
java
public static base_response disable(nitro_service client, nsacl6 resource) throws Exception { nsacl6 disableresource = new nsacl6(); disableresource.acl6name = resource.acl6name; return disableresource.perform_operation(client,"disable"); }
java
public static base_responses disable(nitro_service client, String acl6name[]) throws Exception { base_responses result = null; if (acl6name != null && acl6name.length > 0) { nsacl6 disableresources[] = new nsacl6[acl6name.length]; for (int i=0;i<acl6name.length;i++){ disableresources[i] = new nsacl6(); ...
java
public static base_response rename(nitro_service client, nsacl6 resource, String new_acl6name) throws Exception { nsacl6 renameresource = new nsacl6(); renameresource.acl6name = resource.acl6name; return renameresource.rename_resource(client,new_acl6name); }
java
public static nsacl6[] get(nitro_service service) throws Exception{ nsacl6 obj = new nsacl6(); nsacl6[] response = (nsacl6[])obj.get_resources(service); return response; }
java
public static nsacl6 get(nitro_service service, String acl6name) throws Exception{ nsacl6 obj = new nsacl6(); obj.set_acl6name(acl6name); nsacl6 response = (nsacl6) obj.get_resource(service); return response; }
java
public static nsacl6[] get(nitro_service service, String acl6name[]) throws Exception{ if (acl6name !=null && acl6name.length>0) { nsacl6 response[] = new nsacl6[acl6name.length]; nsacl6 obj[] = new nsacl6[acl6name.length]; for (int i=0;i<acl6name.length;i++) { obj[i] = new nsacl6(); obj[i].set_acl6n...
java
public static service_dospolicy_binding[] get(nitro_service service, String name) throws Exception{ service_dospolicy_binding obj = new service_dospolicy_binding(); obj.set_name(name); service_dospolicy_binding response[] = (service_dospolicy_binding[]) obj.get_resources(service); return response; }
java
public static appfwprofile_csrftag_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_csrftag_binding obj = new appfwprofile_csrftag_binding(); obj.set_name(name); appfwprofile_csrftag_binding response[] = (appfwprofile_csrftag_binding[]) obj.get_resources(service); return response...
java
public static dnsview_binding get(nitro_service service, String viewname) throws Exception{ dnsview_binding obj = new dnsview_binding(); obj.set_viewname(viewname); dnsview_binding response = (dnsview_binding) obj.get_resource(service); return response; }
java
public static base_response update(nitro_service client, nsspparams resource) throws Exception { nsspparams updateresource = new nsspparams(); updateresource.basethreshold = resource.basethreshold; updateresource.throttle = resource.throttle; return updateresource.update_resource(client); }
java
public static base_response unset(nitro_service client, nsspparams resource, String[] args) throws Exception{ nsspparams unsetresource = new nsspparams(); return unsetresource.unset_resource(client,args); }
java
public static nsspparams get(nitro_service service) throws Exception{ nsspparams obj = new nsspparams(); nsspparams[] response = (nsspparams[])obj.get_resources(service); return response[0]; }
java
public static List<Integer> asList(int[] a) { List<Integer> result = new ArrayList<Integer>(a.length); for (int i = 0; i < a.length; i++) { result.add(Integer.valueOf(a[i])); } return result; }
java
public static <T> List<T> makeList(T... items) { List<T> s = new ArrayList<T>(items.length); for (int i = 0; i < items.length; i++) { s.add(items[i]); } return s; }
java
public static <T> Set<T> asSet(T[] o) { return new HashSet<T>(Arrays.asList(o)); }
java
public static <T> Collection<T> diff(Collection<T> list1, Collection<T> list2) { Collection<T> diff = new ArrayList<T>(); for (T t : list1) { if (!list2.contains(t)) { diff.add(t); } } return diff; }
java
public static <E> Collection<E> sampleWithoutReplacement(Collection<E> c, int n) { return sampleWithoutReplacement(c, n, new Random()); }
java
public static <E> Collection<E> sampleWithReplacement(Collection<E> c, int n) { return sampleWithReplacement(c, n, new Random()); }
java
public static <T extends Comparable<T>> int compareLists(List<T> list1, List<T> list2) { if (list1 == null && list2 == null) return 0; if (list1 == null || list2 == null) { throw new IllegalArgumentException(); } int size1 = list1.size(); int size2 = list2.size(); int size = ...
java
public static <T> List<T> toList(Iterable<T> items) { List<T> list = new ArrayList<T>(); addAll(list, items); return list; }
java
public static <T> Set<T> toSet(Iterable<T> items) { Set<T> set = new HashSet<T>(); addAll(set, items); return set; }
java
public static <T> void addAll(Collection<T> collection, Iterable<? extends T> items) { for (T item : items) { collection.add(item); } }
java
public static <T> List<List<T>> getNGrams(List<T> items, int minSize, int maxSize) { List<List<T>> ngrams = new ArrayList<List<T>>(); int listSize = items.size(); for (int i = 0; i < listSize; ++i) { for (int ngramSize = minSize; ngramSize <= maxSize; ++ngramSize) { if (i + ngramSize <= l...
java
public static <T> List<T> flatten(Collection<List<T>> nestedList) { List<T> result = new ArrayList<T>(); for (List<T> list : nestedList) { result.addAll(list); } return result; }
java
public static <ObjType, Hashable> Collection<ObjType> uniqueNonhashableObjects(Collection<ObjType> objects, Function<ObjType, Hashable> customHasher) { Map<Hashable, ObjType> hashesToObjects = new HashMap<Hashable, ObjType>(); for (ObjType object : objects) { hashesToObjects.put(customHasher.apply(obje...
java
public static <T> boolean containsAny(Collection<T> collection, Collection<T> toCheck){ for(T c: toCheck){ if(collection.contains(c)) return true; } return false; }
java
public static <T> T mode(Collection<T> values) { Set<T> modes = modes(values); return modes.iterator().next(); }
java
public static crvserver_binding get(nitro_service service, String name) throws Exception{ crvserver_binding obj = new crvserver_binding(); obj.set_name(name); crvserver_binding response = (crvserver_binding) obj.get_resource(service); return response; }
java
public static base_response restore(nitro_service client, appfwprofile resource) throws Exception { appfwprofile restoreresource = new appfwprofile(); restoreresource.archivename = resource.archivename; return restoreresource.perform_operation(client,"restore"); }
java
public static base_responses restore(nitro_service client, appfwprofile resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { appfwprofile restoreresources[] = new appfwprofile[resources.length]; for (int i=0;i<resources.length;i++){ restoreresource...
java
public static appfwprofile[] get(nitro_service service) throws Exception{ appfwprofile obj = new appfwprofile(); appfwprofile[] response = (appfwprofile[])obj.get_resources(service); return response; }
java
public static appfwprofile get(nitro_service service, String name) throws Exception{ appfwprofile obj = new appfwprofile(); obj.set_name(name); appfwprofile response = (appfwprofile) obj.get_resource(service); return response; }
java
public static base_response add(nitro_service client, route6 resource) throws Exception { route6 addresource = new route6(); addresource.network = resource.network; addresource.gateway = resource.gateway; addresource.vlan = resource.vlan; addresource.weight = resource.weight; addresource.distance = resource...
java
public static base_responses add(nitro_service client, route6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { route6 addresources[] = new route6[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new route6(); addre...
java
public static base_response clear(nitro_service client, route6 resource) throws Exception { route6 clearresource = new route6(); clearresource.routetype = resource.routetype; return clearresource.perform_operation(client,"clear"); }
java
public static base_responses clear(nitro_service client, route6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { route6 clearresources[] = new route6[resources.length]; for (int i=0;i<resources.length;i++){ clearresources[i] = new route6(); ...
java
public static base_response delete(nitro_service client, String network) throws Exception { route6 deleteresource = new route6(); deleteresource.network = network; return deleteresource.delete_resource(client); }
java
public static base_response delete(nitro_service client, route6 resource) throws Exception { route6 deleteresource = new route6(); deleteresource.network = resource.network; deleteresource.gateway = resource.gateway; deleteresource.vlan = resource.vlan; deleteresource.td = resource.td; return deleteresource...
java
public static base_responses delete(nitro_service client, String network[]) throws Exception { base_responses result = null; if (network != null && network.length > 0) { route6 deleteresources[] = new route6[network.length]; for (int i=0;i<network.length;i++){ deleteresources[i] = new route6(); delete...
java
public static base_responses delete(nitro_service client, route6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { route6 deleteresources[] = new route6[resources.length]; for (int i=0;i<resources.length;i++){ deleteresources[i] = new route6(); ...
java
public static base_response update(nitro_service client, route6 resource) throws Exception { route6 updateresource = new route6(); updateresource.network = resource.network; updateresource.gateway = resource.gateway; updateresource.vlan = resource.vlan; updateresource.weight = resource.weight; updateresourc...
java
public static base_responses update(nitro_service client, route6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { route6 updateresources[] = new route6[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new route6(); ...
java
public static route6[] get(nitro_service service) throws Exception{ route6 obj = new route6(); route6[] response = (route6[])obj.get_resources(service); return response; }
java
public static route6[] get(nitro_service service, route6_args args) throws Exception{ route6 obj = new route6(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); route6[] response = (route6[])obj.get_resources(service, option); return response; }
java
public static auditsyslogpolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{ auditsyslogpolicy_vpnglobal_binding obj = new auditsyslogpolicy_vpnglobal_binding(); obj.set_name(name); auditsyslogpolicy_vpnglobal_binding response[] = (auditsyslogpolicy_vpnglobal_binding[]) obj.get_re...
java
public void addWord(MtasCQLParserWordFullCondition w) throws ParseException { assert w.getCondition() .not() == false : "condition word should be positive in sentence definition"; if (!simplified) { partList.add(w); } else { throw new ParseException("already simplified"); } }
java
public void addBasicSentence(MtasCQLParserBasicSentenceCondition s) throws ParseException { if (!simplified) { List<MtasCQLParserBasicSentencePartCondition> newWordList = s .getPartList(); partList.addAll(newWordList); } else { throw new ParseException("already simplified"); ...
java
public void setOccurence(int min, int max) throws ParseException { if (!simplified) { if ((min < 0) || (min > max) || (max < 1)) { throw new ParseException("Illegal number {" + min + "," + max + "}"); } if (min == 0) { optional = true; } minimumOccurence = Math.max(1, m...
java
public static base_response add(nitro_service client, nspbr6 resource) throws Exception { nspbr6 addresource = new nspbr6(); addresource.name = resource.name; addresource.td = resource.td; addresource.action = resource.action; addresource.srcipv6 = resource.srcipv6; addresource.srcipop = resource.srcipop; ...
java
public static base_responses add(nitro_service client, nspbr6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nspbr6 addresources[] = new nspbr6[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new nspbr6(); addre...
java
public static base_response renumber(nitro_service client) throws Exception { nspbr6 renumberresource = new nspbr6(); return renumberresource.perform_operation(client,"renumber"); }
java
public static base_responses renumber(nitro_service client, nspbr6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nspbr6 renumberresources[] = new nspbr6[resources.length]; for (int i=0;i<resources.length;i++){ renumberresources[i] = new nspb...
java
public static base_response update(nitro_service client, nspbr6 resource) throws Exception { nspbr6 updateresource = new nspbr6(); updateresource.name = resource.name; updateresource.action = resource.action; updateresource.srcipv6 = resource.srcipv6; updateresource.srcipop = resource.srcipop; updateresourc...
java
public static base_responses update(nitro_service client, nspbr6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nspbr6 updateresources[] = new nspbr6[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new nspbr6(); ...
java
public static base_response clear(nitro_service client) throws Exception { nspbr6 clearresource = new nspbr6(); return clearresource.perform_operation(client,"clear"); }
java
public static base_response apply(nitro_service client) throws Exception { nspbr6 applyresource = new nspbr6(); return applyresource.perform_operation(client,"apply"); }
java
public static base_responses apply(nitro_service client, nspbr6 resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nspbr6 applyresources[] = new nspbr6[resources.length]; for (int i=0;i<resources.length;i++){ applyresources[i] = new nspbr6(); ...
java
public static nspbr6[] get(nitro_service service) throws Exception{ nspbr6 obj = new nspbr6(); nspbr6[] response = (nspbr6[])obj.get_resources(service); return response; }
java
public static nspbr6[] get(nitro_service service, nspbr6_args args) throws Exception{ nspbr6 obj = new nspbr6(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); nspbr6[] response = (nspbr6[])obj.get_resources(service, option); return response; }
java
public static nspbr6 get(nitro_service service, String name) throws Exception{ nspbr6 obj = new nspbr6(); obj.set_name(name); nspbr6 response = (nspbr6) obj.get_resource(service); return response; }
java
public static spilloverpolicy_stats[] get(nitro_service service) throws Exception{ spilloverpolicy_stats obj = new spilloverpolicy_stats(); spilloverpolicy_stats[] response = (spilloverpolicy_stats[])obj.stat_resources(service); return response; }
java
public static spilloverpolicy_stats get(nitro_service service, String name) throws Exception{ spilloverpolicy_stats obj = new spilloverpolicy_stats(); obj.set_name(name); spilloverpolicy_stats response = (spilloverpolicy_stats) obj.stat_resource(service); return response; }
java
public static appfwprofile_xmlvalidationurl_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_xmlvalidationurl_binding obj = new appfwprofile_xmlvalidationurl_binding(); obj.set_name(name); appfwprofile_xmlvalidationurl_binding response[] = (appfwprofile_xmlvalidationurl_binding[]) ...
java
public static vpnvserver_responderpolicy_binding[] get(nitro_service service, String name) throws Exception{ vpnvserver_responderpolicy_binding obj = new vpnvserver_responderpolicy_binding(); obj.set_name(name); vpnvserver_responderpolicy_binding response[] = (vpnvserver_responderpolicy_binding[]) obj.get_resourc...
java
public static base_response add(nitro_service client, responderpolicy resource) throws Exception { responderpolicy addresource = new responderpolicy(); addresource.name = resource.name; addresource.rule = resource.rule; addresource.action = resource.action; addresource.undefaction = resource.undefaction; ad...
java
public static base_response update(nitro_service client, responderpolicy resource) throws Exception { responderpolicy updateresource = new responderpolicy(); updateresource.name = resource.name; updateresource.rule = resource.rule; updateresource.action = resource.action; updateresource.undefaction = resource...
java
public static base_responses update(nitro_service client, responderpolicy resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { responderpolicy updateresources[] = new responderpolicy[resources.length]; for (int i=0;i<resources.length;i++){ updatere...
java
public static base_response unset(nitro_service client, responderpolicy resource, String[] args) throws Exception{ responderpolicy unsetresource = new responderpolicy(); unsetresource.name = resource.name; return unsetresource.unset_resource(client,args); }
java
public static base_response rename(nitro_service client, responderpolicy resource, String new_name) throws Exception { responderpolicy renameresource = new responderpolicy(); renameresource.name = resource.name; return renameresource.rename_resource(client,new_name); }
java
public static responderpolicy[] get(nitro_service service) throws Exception{ responderpolicy obj = new responderpolicy(); responderpolicy[] response = (responderpolicy[])obj.get_resources(service); return response; }
java
public static responderpolicy get(nitro_service service, String name) throws Exception{ responderpolicy obj = new responderpolicy(); obj.set_name(name); responderpolicy response = (responderpolicy) obj.get_resource(service); return response; }
java
public static hanode_routemonitor6_binding[] get(nitro_service service, Long id) throws Exception{ hanode_routemonitor6_binding obj = new hanode_routemonitor6_binding(); obj.set_id(id); hanode_routemonitor6_binding response[] = (hanode_routemonitor6_binding[]) obj.get_resources(service); return response; }
java
public HashMap<String, IndexInput> getIndexInputList() { HashMap<String, IndexInput> clonedIndexInputList = new HashMap<String, IndexInput>(); for (Entry<String, IndexInput> entry : indexInputList.entrySet()) { clonedIndexInputList.put(entry.getKey(), entry.getValue().clone()); } return clonedInde...
java
public static base_response delete(nitro_service client, systementitydata resource) throws Exception { systementitydata deleteresource = new systementitydata(); deleteresource.type = resource.type; deleteresource.name = resource.name; deleteresource.alldeleted = resource.alldeleted; deleteresource.allinactive...
java
public static systementitydata[] get(nitro_service service, systementitydata_args args) throws Exception{ systementitydata obj = new systementitydata(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); systementitydata[] response = (systementitydata[])obj.get_res...
java
public static dos_stats get(nitro_service service, options option) throws Exception{ dos_stats obj = new dos_stats(); dos_stats[] response = (dos_stats[])obj.stat_resources(service,option); return response[0]; }
java
public static base_response add(nitro_service client, linkset resource) throws Exception { linkset addresource = new linkset(); addresource.id = resource.id; return addresource.add_resource(client); }
java
public static base_response delete(nitro_service client, String id) throws Exception { linkset deleteresource = new linkset(); deleteresource.id = id; return deleteresource.delete_resource(client); }
java
public static linkset[] get(nitro_service service) throws Exception{ linkset obj = new linkset(); linkset[] response = (linkset[])obj.get_resources(service); return response; }
java
public static linkset get(nitro_service service, String id) throws Exception{ linkset obj = new linkset(); obj.set_id(id); linkset response = (linkset) obj.get_resource(service); return response; }
java
public static nsrollbackcmd get(nitro_service service) throws Exception{ nsrollbackcmd obj = new nsrollbackcmd(); nsrollbackcmd[] response = (nsrollbackcmd[])obj.get_resources(service); return response[0]; }
java
public static nsrollbackcmd[] get(nitro_service service, nsrollbackcmd_args args) throws Exception{ nsrollbackcmd obj = new nsrollbackcmd(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); nsrollbackcmd[] response = (nsrollbackcmd[])obj.get_resources(service, op...
java
private int getPositiveInteger(String number) { try { return Math.max(0, Integer.parseInt(number)); } catch (NumberFormatException e) { return 0; } }
java
public static cachepolicylabel_binding get(nitro_service service, String labelname) throws Exception{ cachepolicylabel_binding obj = new cachepolicylabel_binding(); obj.set_labelname(labelname); cachepolicylabel_binding response = (cachepolicylabel_binding) obj.get_resource(service); return response; }
java
public static sslvserver_sslciphersuite_binding[] get(nitro_service service, String vservername) throws Exception{ sslvserver_sslciphersuite_binding obj = new sslvserver_sslciphersuite_binding(); obj.set_vservername(vservername); sslvserver_sslciphersuite_binding response[] = (sslvserver_sslciphersuite_binding[])...
java
public static long count(nitro_service service, String vservername) throws Exception{ sslvserver_sslciphersuite_binding obj = new sslvserver_sslciphersuite_binding(); obj.set_vservername(vservername); options option = new options(); option.set_count(true); sslvserver_sslciphersuite_binding response[] = (sslvs...
java
public static base_response add(nitro_service client, nssimpleacl resource) throws Exception { nssimpleacl addresource = new nssimpleacl(); addresource.aclname = resource.aclname; addresource.aclaction = resource.aclaction; addresource.td = resource.td; addresource.srcip = resource.srcip; addresource.destpo...
java
public static base_response clear(nitro_service client) throws Exception { nssimpleacl clearresource = new nssimpleacl(); return clearresource.perform_operation(client,"clear"); }
java
public static base_response delete(nitro_service client, nssimpleacl resource) throws Exception { nssimpleacl deleteresource = new nssimpleacl(); deleteresource.aclname = resource.aclname; return deleteresource.delete_resource(client); }
java
public static base_response flush(nitro_service client, nssimpleacl resource) throws Exception { nssimpleacl flushresource = new nssimpleacl(); flushresource.estsessions = resource.estsessions; return flushresource.perform_operation(client,"flush"); }
java
public static nssimpleacl[] get(nitro_service service) throws Exception{ nssimpleacl obj = new nssimpleacl(); nssimpleacl[] response = (nssimpleacl[])obj.get_resources(service); return response; }
java
public static nssimpleacl get(nitro_service service, String aclname) throws Exception{ nssimpleacl obj = new nssimpleacl(); obj.set_aclname(aclname); nssimpleacl response = (nssimpleacl) obj.get_resource(service); return response; }
java
public static nssimpleacl[] get(nitro_service service, String aclname[]) throws Exception{ if (aclname !=null && aclname.length>0) { nssimpleacl response[] = new nssimpleacl[aclname.length]; nssimpleacl obj[] = new nssimpleacl[aclname.length]; for (int i=0;i<aclname.length;i++) { obj[i] = new nssimpleacl...
java
public static base_response update(nitro_service client, nstimeout resource) throws Exception { nstimeout updateresource = new nstimeout(); updateresource.zombie = resource.zombie; updateresource.client = resource.client; updateresource.server = resource.server; updateresource.httpclient = resource.httpclient...
java
public static base_response unset(nitro_service client, nstimeout resource, String[] args) throws Exception{ nstimeout unsetresource = new nstimeout(); return unsetresource.unset_resource(client,args); }
java
public static nstimeout get(nitro_service service) throws Exception{ nstimeout obj = new nstimeout(); nstimeout[] response = (nstimeout[])obj.get_resources(service); return response[0]; }
java
private Map<String, Entry> readEntries(String mapping, boolean ignoreCase) { Map<String, Entry> entries = new HashMap<>(); try { // ms, 2010-10-05: try to load the file from the CLASSPATH first InputStream is = getClass().getClassLoader().getResourceAsStream(mapping); // if not found in the CLASSPATH, loa...
java
@Override public <VALUEBASE, VALUE extends VALUEBASE, KEY extends Key<CoreMap, VALUEBASE>> VALUE set(Class<KEY> key, VALUE value) { if (immutableKeys.contains(key)) { throw new HashableCoreMapException("Attempt to change value " + "of immutable field "+key.getSimpleName()); } ...
java