1 | |
package com.lexicalscope.jewel.cli; |
2 | |
|
3 | |
import java.util.HashMap; |
4 | |
import java.util.Map; |
5 | |
|
6 | |
import com.lexicalscope.jewel.cli.specification.OptionSpecification; |
7 | |
|
8 | 0 | class TypedArgumentsImpl implements TypedArguments |
9 | |
{ |
10 | 0 | private final Map<OptionSpecification, Object> m_values = new HashMap<OptionSpecification, Object>(); |
11 | |
private Object m_unparsedValue; |
12 | |
|
13 | |
void add(final OptionSpecification optionSpecification, final Object value) |
14 | |
{ |
15 | 0 | m_values.put(optionSpecification, value); |
16 | 0 | } |
17 | |
|
18 | |
public boolean contains(final OptionSpecification optionSpecification) |
19 | |
{ |
20 | 0 | return m_values.containsKey(optionSpecification); |
21 | |
} |
22 | |
|
23 | |
public Object getValue(final OptionSpecification optionSpecification) |
24 | |
{ |
25 | 0 | return m_values.get(optionSpecification); |
26 | |
} |
27 | |
|
28 | |
void setUnparsedValue(final Object unparsedValue) |
29 | |
{ |
30 | 0 | m_unparsedValue = unparsedValue; |
31 | 0 | } |
32 | |
|
33 | |
public Object getUnparsedValue() |
34 | |
{ |
35 | 0 | return m_unparsedValue; |
36 | |
} |
37 | |
|
38 | |
public boolean hasUnparsedValue() |
39 | |
{ |
40 | 0 | return m_unparsedValue != null; |
41 | |
} |
42 | |
} |