com.github.fge.uritemplate.vars.values
Class VariableValue

java.lang.Object
  extended by com.github.fge.uritemplate.vars.values.VariableValue
Direct Known Subclasses:
ListValue, MapValue, ScalarValue

public abstract class VariableValue
extends Object

Abstract class for one variable value


Field Summary
protected static MessageBundle BUNDLE
           
 
Constructor Summary
protected VariableValue(ValueType type)
           
 
Method Summary
 List<String> getListValue()
          Get a list for this value
 Map<String,String> getMapValue()
          Get a map for this value
 String getScalarValue()
          Get a simple string for this value
 ValueType getType()
          Get the type for this value
abstract  boolean isEmpty()
          Tell whether this value is empty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUNDLE

protected static final MessageBundle BUNDLE
Constructor Detail

VariableValue

protected VariableValue(ValueType type)
Method Detail

getType

public final ValueType getType()
Get the type for this value

Returns:
the value type

getScalarValue

public String getScalarValue()
Get a simple string for this value

Only valid for string values

Returns:
the string
Throws:
IllegalArgumentException - value is not a string value

getListValue

public List<String> getListValue()
Get a list for this value

Only valid for list values

Returns:
the list
Throws:
IllegalArgumentException - value is not a list value

getMapValue

public Map<String,String> getMapValue()
Get a map for this value

Only valid for map values

Returns:
the map
Throws:
IllegalArgumentException - value is not a map value

isEmpty

public abstract boolean isEmpty()
Tell whether this value is empty

For strings, this tells whether the string itself is empty. For lists and maps, this tells whether the list or map have no elements/entries.

Returns:
true if the value is empty