@Override public void append(APart pa) { operations = MCollection.append(operations, pa); }
@Override public List<String> getNodeKeys() { //return (String[]) properties.keySet().toArray(new String[properties.size()]); return MCollection.getEmptyList(); }
@Override public List<String> getPropertyKeys() { return MCollection.toList( properties.keySet() ); }
@Override public List<IConfig> getNodes(String key) { LinkedList<IConfig> list = children.get(key); if (list == null || list.size() == 0) return MCollection.getEmptyList(); return MCollection.toReadOnlyList(list); }
public void enableProcessVersion(String deployedName) { // add version String v = MString.afterIndex(deployedName, ':'); String n = MString.beforeIndex(deployedName, ':'); String[] versions = String.valueOf(getParameters().getOrDefault("process:" + n + ":versions","")).split(","); if (!MCollection.contains(versions, v)) { versions = MCollection.append(versions, v); getParameters().put("process:" + n + ":versions", MString.join(versions,',')); } }
public boolean isProcessEnabled(String name, String version) { String[] versions = String.valueOf(getParameters().getOrDefault("process:" + name + ":versions","")).split(","); return MCollection.contains(versions, version); }
public static boolean isSet(Collection<?> col) { return !isEmpty(col); }
if (i != 0 && out[i-1] >= out[1]) needOrder = true; if (needOrder) out = MCollection.order(out, false); return out;
public static boolean isEmpty(Object[] array) { return array == null || array.length == 0 || isAllNull(array); }
public Collection<?> getSelectedValues() { Object o = getValue(); if (o == null) return new LinkedList<Object>(); // this should not happen ... if (o instanceof Collection) return (Collection<?>)o; LinkedList<Object> out = new LinkedList<Object>(); if (o instanceof Object[]) { MCollection.copyArray((Object[])o, out); } else out.add(o); return out; }
@Override public List<IConfig> getNodes() { LinkedList<IConfig> out = new LinkedList<>(); for ( Map.Entry<String, JsonNode> entry : MCollection.iterate(node.getFields()) ) { JsonNode child = entry.getValue(); String childName = entry.getKey(); if (child !=null && child.isArray()) { for (int i = 0; i < child.size(); i++) out.add( new JsonConfig(childName, this, child.get(i))); } else if (child !=null && child.isObject()) out.add( new JsonConfig(childName, this, child)); } return out; }
/** * Append the item to the end of the list using the separator if not already exists. * If list is empty the item will be the first element. * * @param list The list of items * @param separator The item separator * @param item New item to append * @return The new list */ public static String set(String list, char separator, String item) { if (item == null) return list; if (MString.isEmpty(list)) return item; if (contains(list, separator, item)) return list; return list + separator + item; }
public static boolean isSet(Map<?,?> map) { return !isEmpty(map); }
if (needOrder) out = MCollection.order(out, false); return out;
@Override public List<String> getNodeKeys() { //return (String[]) properties.keySet().toArray(new String[properties.size()]); return MCollection.getEmptyList(); }
/** * Enabled means the version can be instantiated. * @param name * @return true if it's allowed */ public boolean isProcessEnabled(String name) { String v = MString.afterIndex(name, ':'); String n = MString.beforeIndex(name, ':'); String[] versions = String.valueOf(getParameters().getOrDefault("process:" + n + ":versions","")).split(","); return MCollection.contains(versions, v); }
public InterceptorChain append(JmsInterceptor ... interceptors) { synchronized (this) { chain = MCollection.append(chain,interceptors); } return this; }
@Override public Collection<String> getPropertyKeys() { return MCollection.toList(properties.keySet()); }
public static boolean isSet(Object[] array) { return !isEmpty(array); }
@Override public List<IConfig> getNodes(String key) { return MCollection.getEmptyList(); }