public boolean equals(Object o) { if (o==this) return true; if ( ! (o instanceof ComponentSpecification)) return false; ComponentSpecification c = (ComponentSpecification) o; return c.stringValue.equals(this.stringValue()); }
private static List<String> getComponents(Collection<ComponentSpecification> componentSpecs) { List<String> components = new ArrayList<>(); for (ComponentSpecification spec : componentSpecs) components.add(spec.stringValue()); return components; }
private static void bundleInstantiationSpecification(Components.Builder config, BundleInstantiationSpecification spec) { config.classId(spec.classId.stringValue()); config.bundle(spec.bundle.stringValue()); }
/** * Returns the requested renderer. * * @param format the id or format alias of the renderer to return. If null is passed the default renderer * is returned * @throws IllegalArgumentException if the renderer cannot be resolved */ public com.yahoo.processing.rendering.Renderer<Result> getRenderer(ComponentSpecification format) { if (format == null || format.stringValue().equals("default")) return getDefaultRenderer(); if (format.stringValue().equals("json")) return getComponent(jsonRendererId); if (format.stringValue().equals("xml")) return getComponent(xmlRendererId); if (format.stringValue().equals("page")) return getComponent(pageRendererId); com.yahoo.processing.rendering.Renderer<Result> renderer = getComponent(format); if (renderer == null) throw new IllegalArgumentException("No renderer with id or alias '" + format + "'. " + "Available renderers are: [" + rendererNames() + "]."); return renderer; }
@Override public void getConfig(ServerConfig.Builder builder) { for (final Binding binding : bindings) { builder.filter( new ServerConfig.Filter.Builder() .id(binding.filterId.stringValue()) .binding(binding.binding)); } }
@Override public void getConfig(HttpFilterConfig.Builder builder) { builder.filterName(filterModel.getComponentId().stringValue()) .filterClass(filterModel.getClassId().stringValue()); for (Map.Entry<String, String> param : configMap.entrySet()) { builder.param( new Param.Builder() .name(param.getKey()) .value(param.getValue())); } }