private ModelCoordinate createIndexCoordinateWithRemoteUrlHint(String remoteUrl) { ModelCoordinate mc = new ModelCoordinate( INDEX.getGroupId(), INDEX.getArtifactId(), INDEX.getClassifier(), INDEX.getExtension(), INDEX.getVersion()); return createCopyWithRepositoryUrlHint(mc, remoteUrl); }
void updateModel(final OperationContext context, ModelNode model, ModelNode listAttribute) throws OperationFailedException { int index = INDEX.resolveModelAttribute(context, model).asInt(); if (listAttribute.hasDefined(index)) { context.getResult().set(listAttribute.get(index)); } }
void updateModel(final OperationContext context, ModelNode model, ModelNode listAttribute) throws OperationFailedException { ModelNode value = VALUE.resolveModelAttribute(context, model); ModelNode index = INDEX.resolveModelAttribute(context, model); List<ModelNode> res = new ArrayList<>(listAttribute.asList()); if (index.isDefined()) { res.remove(index.asInt()); } else { res.remove(value); } listAttribute.set(res); }
void updateModel(final OperationContext context, ModelNode model, ModelNode listAttribute) throws OperationFailedException { String value = VALUE.resolveModelAttribute(context, model).asString(); ModelNode indexNode = INDEX.resolveModelAttribute(context, model); LinkedList<ModelNode> res = new LinkedList<>( listAttribute.isDefined() ? listAttribute.asList() : Collections.<ModelNode>emptyList()); if (indexNode.isDefined()) { res.add(indexNode.asInt(), new ModelNode(value)); } else { res.add(new ModelNode(value)); } listAttribute.set(res); }
private void addSeriesToPlot( int index, XYLineChart xyLineChart, double[] iterations, int series) { double[] values = new double[index + 1]; System.arraycopy(this.history[series], 0, values, 0, index + 1); xyLineChart.addSeries(INDEX.values()[series].enName, iterations, values); }
private boolean isIndex(ModelCoordinate model) { return model.getGroupId().equals(INDEX.getGroupId()) && model.getArtifactId().equals(INDEX.getArtifactId()) && model.getExtension().equals(INDEX.getExtension()) && model.getVersion().equals(INDEX.getVersion()); }