| /** |
| * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| */ |
| package org.eclipse.osbp.runtime.common.help; |
| |
| import java.util.HashMap; |
| import java.util.Map; |
| |
| // TODO: Auto-generated Javadoc |
| /** |
| * The Class HelpRequestBuilder. |
| */ |
| public class HelpRequestBuilder { |
| |
| /** The properties. */ |
| private Map<String, Object> properties = new HashMap<String, Object>(); |
| |
| /** |
| * Instantiates a new help request builder. |
| */ |
| private HelpRequestBuilder() { |
| |
| } |
| |
| /** |
| * New request. |
| * |
| * @return the help request builder |
| */ |
| public static final HelpRequestBuilder newRequest() { |
| return new HelpRequestBuilder(); |
| } |
| |
| /** |
| * The type of the help. |
| * |
| * @param requestType |
| * the request type |
| * @return the help request builder |
| */ |
| public HelpRequestBuilder type(String requestType) { |
| properties.put(IHelpService.TYPE__TASK, requestType); |
| return this; |
| } |
| |
| /** |
| * An id which identifies the help for the requestType. |
| * |
| * @param id |
| * the id |
| * @return the help request builder |
| */ |
| public HelpRequestBuilder id(Object id) { |
| properties.put(IHelpService.PROP__ID, id); |
| return this; |
| } |
| |
| /** |
| * Any kind of data. |
| * |
| * @param data |
| * the data |
| * @return the help request builder |
| */ |
| public HelpRequestBuilder data(Object data) { |
| properties.put(IHelpService.PROP__DATA, data); |
| return this; |
| } |
| |
| /** |
| * Pass any property. |
| * |
| * @param key |
| * the key |
| * @param value |
| * the value |
| * @return the help request builder |
| */ |
| public HelpRequestBuilder property(String key, Object value) { |
| properties.put(key, value); |
| return this; |
| } |
| |
| /** |
| * Returns the resulting request parameters. |
| * |
| * @return the map |
| */ |
| public Map<String, Object> toRequest() { |
| return new HashMap<String, Object>(properties); |
| } |
| |
| } |