@Override public Set<java.util.Map.Entry<String, Object>> entrySet() { return parent.entrySet(); }
@Override public Collection<Object> values() { HashSet<Object> out = new HashSet<>(); for (java.util.Map.Entry<String, Object> entry : parent.entrySet()) { if (entry.getKey().startsWith(prefix)) out.add(entry.getValue()); } return out; }
@Override public boolean containsValue(Object value) { for (java.util.Map.Entry<String, Object> entry : parent.entrySet()) { if (entry.getKey().startsWith(prefix)) if (value.equals(entry.getValue())) return true; } return false; }
public MProperties(IProperties in) { this.properties = new Properties(); if (in != null) for (Map.Entry<?, ?> e : in.entrySet()) if (e.getKey() != null && e.getValue() != null) this.properties.put(String.valueOf( e.getKey() ), e.getValue()); }
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public Set<java.util.Map.Entry<String, Object>> entrySet() { HashSet<java.util.Map.Entry<String, Object>> out = new HashSet<>(); for (java.util.Map.Entry<String, Object> entry : parent.entrySet()) { if (entry.getKey().startsWith(prefix)) { out.add(new MapEntry(entry.getKey().substring(len), entry.getValue())); } } return out; }
@Override public OperationResult doExecuteInternal(CaoConfiguration configuration, Monitor monitor) throws CaoException { if (!canExecute(configuration)) return new NotSuccessful(getName(), "can't execute", -1); try { FsNode parent = (FsNode)configuration.getList().get(0); File nextFile = new File(parent.getFile(), configuration.getProperties().getString(CreateConfiguration.NAME) ); nextFile.mkdir(); CaoNode nextNode = parent.getNode(nextFile.getName()); CaoWritableElement nextWrite = nextNode.getWritableNode(); for (Entry<String, Object> entry : configuration.getProperties().entrySet()) { if (!entry.getKey().startsWith("_")) nextWrite.put(entry.getKey(), entry.getValue()); } nextWrite.getUpdateAction().doExecute(monitor); nextNode.reload(); return new Successful(getName(),"ok",0,nextNode); } catch (Throwable t) { log().d(t); return new NotSuccessful(getName(),t.toString(),-1); } }
@Override public OperationResult doExecuteInternal(CaoConfiguration configuration, Monitor monitor) throws CaoException { if (!canExecute(configuration)) return new NotSuccessful(getName(), "can't execute", -1); try { FdbNode parent = (FdbNode)configuration.getList().get(0); File nextFile = new File(parent.getFile(), configuration.getProperties().getString(CreateConfiguration.NAME) ); nextFile.mkdir(); ((FdbCore)core).indexFile(nextFile); CaoNode nextNode = parent.getNode(nextFile.getName()); CaoWritableElement nextWrite = nextNode.getWritableNode(); for (Entry<String, Object> entry : configuration.getProperties().entrySet()) { if (!entry.getKey().startsWith("_")) nextWrite.put(entry.getKey(), entry.getValue()); } nextWrite.getUpdateAction().doExecute(monitor); nextNode.reload(); Changes change = nextNode.adaptTo(Changes.class); if (change != null) change.created(); return new Successful(getName(),"ok",0,nextNode); } catch (Throwable t) { log().d(t); return new NotSuccessful(getName(),t.toString(),-1); } }
for (Entry<String, Object> entry : values.entrySet()) { String name = entry.getKey(); if (name.startsWith("_")) // ignore internal