protected PersistedList(Collection<? extends T> initialList) { data.replaceBy(initialList); }
/** * Completely replaces this list by the contents of the given list. */ public void replaceBy(E... that) { replaceBy(Arrays.asList(that)); }
public void replaceBy(Collection<? extends T> col) throws IOException { data.replaceBy(col); onModified(); }
/** * A convenience method to replace a single item. * * This method shouldn't be used when you are replacing a lot of stuff * as copy-on-write semantics make this rather slow. */ public void replace(T from, T to) throws IOException { List<T> copy = new ArrayList<T>(data.getView()); for (int i=0; i<copy.size(); i++) { if (copy.get(i).equals(from)) copy.set(i,to); } data.replaceBy(copy); }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { try { DescribableList r = (DescribableList) context.getRequiredType().asSubclass(DescribableList.class).newInstance(); CopyOnWriteList core = copyOnWriteListConverter.unmarshal(reader, context); r.data.replaceBy(core); return r; } catch (InstantiationException e) { InstantiationError x = new InstantiationError(); x.initCause(e); throw x; } catch (IllegalAccessException e) { IllegalAccessError x = new IllegalAccessError(); x.initCause(e); throw x; } } }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { CopyOnWriteList core = copyOnWriteListConverter.unmarshal(reader, context); try { PersistedList r = (PersistedList)context.getRequiredType().newInstance(); r.data.replaceBy(core); return r; } catch (InstantiationException e) { InstantiationError x = new InstantiationError(); x.initCause(e); throw x; } catch (IllegalAccessException e) { IllegalAccessError x = new IllegalAccessError(); x.initCause(e); throw x; } } }
/** * Accepts submission from the configuration page. */ @RequirePOST public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { JSONObject src = req.getSubmittedForm(); String newName = src.getString("name"), redirect = "."; XmlFile oldFile = null; if(!name.equals(newName)) { Jenkins.checkGoodName(newName); oldFile = getConfigFile(); // rename getParent().logRecorders.remove(name); this.name = newName; getParent().logRecorders.put(name,this); redirect = "../" + Util.rawEncode(newName) + '/'; } List<Target> newTargets = req.bindJSONToList(Target.class, src.get("targets")); for (Target t : newTargets) t.enable(); targets.replaceBy(newTargets); save(); if (oldFile!=null) oldFile.delete(); rsp.sendRedirect2(redirect); }
/** * Completely replaces this list by the contents of the given list. */ public void replaceBy(E... that) { replaceBy(Arrays.asList(that)); }
/** * Completely replaces this list by the contents of the given list. */ public void replaceBy(E... that) { replaceBy(Arrays.asList(that)); }
/** * Completely replaces this list by the contents of the given list. */ public void replaceBy(E... that) { replaceBy(Arrays.asList(that)); }
/** * Completely replaces this list by the contents of the given list. */ public void replaceBy(E... that) { replaceBy(Arrays.asList(that)); }
/** * Completely replaces this list by the contents of the given list. */ public void replaceBy(E... that) { replaceBy(Arrays.asList(that)); }
/** * Replaces the configured Groovy parsers with the given collection. * * @param parsers the new parsers */ public void replaceGroovyParsers(final Collection<GroovyParser> parsers) { groovyParsers.replaceBy(parsers); save(); }
public void replaceBy(Collection<? extends T> col) throws IOException { data.replaceBy(col); onModified(); }
public void replaceBy(Collection<? extends T> col) throws IOException { data.replaceBy(col); onModified(); }
@Override public boolean configure(StaplerRequest req, net.sf.json.JSONObject json) throws FormException { profiles.replaceBy(req.bindParametersToList(S3Profile.class, "s3.")); save(); return true; }
@Override public boolean configure(final StaplerRequest req, final JSONObject formData) { groovyParsers.replaceBy(req.bindJSONToList(GroovyParser.class, formData.get("parsers"))); save(); return true; }
@Override public boolean configure(StaplerRequest req, JSONObject formData) { sites.replaceBy(req.bindJSONToList(JiraSite.class, formData.get("sites"))); save(); return true; } }
@Override public boolean configure(final StaplerRequest req, final JSONObject formData) { groovyParsers.replaceBy(req.bindJSONToList(GroovyParser.class, formData.get("parsers"))); save(); return true; }
@Override public boolean configure(StaplerRequest req, JSONObject formData) { Stapler.CONVERT_UTILS.deregister(java.net.URL.class); Stapler.CONVERT_UTILS.register(new EmptyFriendlyURLConverter(), java.net.URL.class); sites.replaceBy(req.bindJSONToList(Site.class, formData.get("sites"))); save(); return true; }