Ignore:
Timestamp:
2017-07-31T11:38:47+02:00 (7 years ago)
Author:
bastiK
Message:

see #14794 - javadoc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/ActionParameter.java

    r6792 r12546  
    44import org.openstreetmap.josm.actions.search.SearchAction.SearchSetting;
    55
     6/**
     7 * Abstract class for <i>key=value</i> parameters, used in {@link ParameterizedAction}.
     8 * <p>
     9 * The key ({@link #name}) is a string and the value of class {@link T}. The value can be
     10 * converted to and from a string.
     11 * @param <T> the value type
     12 */
    613public abstract class ActionParameter<T> {
    714
    815    private final String name;
    916
     17    /**
     18     * Constructs a new ActionParameter.
     19     * @param name parameter name (the key)
     20     */
    1021    public ActionParameter(String name) {
    1122        this.name = name;
    1223    }
    1324
     25    /**
     26     * Get the name of this action parameter.
     27     * The name is used as a key, to look up values for the parameter.
     28     * @return the name of this action parameter
     29     */
    1430    public String getName() {
    1531        return name;
    1632    }
    1733
     34    /**
     35     * Get the value type of this action parameter.
     36     * @return the value type of this action parameter
     37     */
    1838    public abstract Class<T> getType();
    1939
     40    /**
     41     * Convert a given value into a string (serialization).
     42     * @param value the value
     43     * @return a string representation of the value
     44     */
    2045    public abstract String writeToString(T value);
    2146
     47    /**
     48     * Create a value from the given string representation (deserialization).
     49     * @param s the string representation of the value
     50     * @return the corresponding value object
     51     */
    2252    public abstract T readFromString(String s);
    2353
     54    /**
     55     * Simple ActionParameter implementation for string values.
     56     */
    2457    public static class StringActionParameter extends ActionParameter<String> {
    2558
Note: See TracChangeset for help on using the changeset viewer.