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 class TypedArgumentsImpl implements TypedArguments 9 { 10 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 m_values.put(optionSpecification, value); 16 } 17 18 public boolean contains(final OptionSpecification optionSpecification) 19 { 20 return m_values.containsKey(optionSpecification); 21 } 22 23 public Object getValue(final OptionSpecification optionSpecification) 24 { 25 return m_values.get(optionSpecification); 26 } 27 28 void setUnparsedValue(final Object unparsedValue) 29 { 30 m_unparsedValue = unparsedValue; 31 } 32 33 public Object getUnparsedValue() 34 { 35 return m_unparsedValue; 36 } 37 38 public boolean hasUnparsedValue() 39 { 40 return m_unparsedValue != null; 41 } 42 }