public ModifiableEntryBuilder setProgressLog(String progressLog) { valueMap.put(PROGRESS_LOG_PROPERTY, progressLog); return this; }
public SynthesizedResource putProperty(String key, Object value) { synthProperties.put(key, value); return this; // yeah, i like fluent APIs }
public SynthesizedResource putProperty(String key, Object value) { synthProperties.put(key, value); return this; // yeah, i like fluent APIs }
public ModifiableEntryBuilder setFilePath(String filePath) { valueMap.put(FILE_PATH_PROPERTY, filePath); return this; }
public ModifiableEntryBuilder setExecutor(String executor) { valueMap.put(EXECUTOR_PROPERTY, executor); return this; }
public ModifiableEntryBuilder setInstanceHostname(String instanceHostname) { valueMap.put(INSTANCE_HOSTNAME_PROPERTY, instanceHostname); return this; }
@Override public final Object put(final String s, final Object o) { return this.metaDataMap.put(s, o); }
public ModifiableEntryBuilder setExecutor(String executor) { valueMap.put(EXECUTOR_PROPERTY, executor); return this; }
public void setProperty(final String name, final Object value) { if ( value == null ) { this.properties.remove(name); } else { this.properties.put(name, value); } }
/** * Custom properties that my be used by application-specific markup builders or processors. * @param key Property key * @param value Property value * @return this */ public @NotNull LinkArgs property(String key, Object value) { if (key == null) { throw new IllegalArgumentException("Key argument must not be null."); } getProperties().put(key, value); return this; }
public ImageResourceWrapper(@Nonnull Resource resource, @Nonnull String resourceType) { super(resource); if (StringUtils.isEmpty(resourceType)) { throw new IllegalArgumentException("The " + ImageResourceWrapper.class.getName() + " needs to override the resource type of " + "the wrapped resource, but the resourceType argument was null or empty."); } this.resourceType = resourceType; valueMap = new ValueMapDecorator(new HashMap<>(resource.getValueMap())); valueMap.put(ResourceResolver.PROPERTY_RESOURCE_TYPE, resourceType); }
@Activate protected final void activate(Map<String, String> map) { config = new ValueMapDecorator(new HashMap<String, Object>()); config.put(CONFIG_RESULTS, PropertiesUtil.toStringArray(map.get(PROP_RESULT_MODES), DEFAULT_RESULT_MODES)); } }
@Activate protected final void activate(Map<String, String> map) { config = new ValueMapDecorator(new HashMap<String, Object>()); config.put(CONFIG_RESULTS, PropertiesUtil.toStringArray(map.get(PROP_RESULT_MODES), DEFAULT_RESULT_MODES)); } }
/** * Creates a virtual resource to use in the resulting datasource. */ @Nonnull private Resource createResource(@Nonnull ResourceResolver resolver, @Nonnull String title, @Nonnull String value) { ValueMap properties = new ValueMapDecorator(new HashMap<>()); properties.put("text", title); properties.put("value", value); return new ValueMapResource(resolver, new ResourceMetadata(), RESOURCE_TYPE_NON_EXISTING, properties); }
public SampleResource(final ResourceResolver resourceResolver, final String path, final ValueMap valueMap) { this.path = path; this.resourceResolver = resourceResolver; // Set the properties for the ValueMap this.valueMap = valueMap; // Other "universal" properties can be added here this.valueMap.put(ResourceResolver.PROPERTY_RESOURCE_TYPE, RESOURCE_TYPE); this.valueMap.put("generatedAt", new Date()); // Set the resolutionPath for this resource to the resource's path this.metadata = new ResourceMetadata(); this.metadata.setResolutionPath(path); new SampleResource.SampleValueMap("foo", 2, 3); }
@Override public ValueMap getValueMap() { ValueMap superMap = super.getValueMap(); for (Map.Entry<String, Object> entry : superMap.entrySet()) { if (!synthProperties.containsKey(entry.getKey())) { synthProperties.put(entry.getKey(), entry.getValue()); } } return synthProperties; }
@Override public ValueMap getValueMap() { ValueMap superMap = super.getValueMap(); for (Map.Entry<String, Object> entry : superMap.entrySet()) { if (!synthProperties.containsKey(entry.getKey())) { synthProperties.put(entry.getKey(), entry.getValue()); } } return synthProperties; }
/** * Update the information for a retry */ public void retry() { final int retries = this.getProperty(Job.PROPERTY_JOB_RETRY_COUNT, Integer.class); this.properties.put(Job.PROPERTY_JOB_RETRY_COUNT, retries + 1); this.properties.remove(Job.PROPERTY_JOB_STARTED_TIME); }