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

java.lang.Object
  extended by com.github.fge.uritemplate.vars.values.VariableValue
      extended by com.github.fge.uritemplate.vars.values.ScalarValue

@Immutable
public final class ScalarValue
extends VariableValue

Simple string variable value

Note that the constructor takes an arbitrary type as an argument. It is the caller's responsibility to ensure that this value has a correct .toString() implementation.


Field Summary
 
Fields inherited from class com.github.fge.uritemplate.vars.values.VariableValue
BUNDLE
 
Constructor Summary
ScalarValue(Object value)
          Constructor
 
Method Summary
 String getScalarValue()
          Get a simple string for this value
 boolean isEmpty()
          Tell whether this value is empty
 
Methods inherited from class com.github.fge.uritemplate.vars.values.VariableValue
getListValue, getMapValue, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScalarValue

public ScalarValue(Object value)
Constructor

Parameters:
value - the value
Throws:
NullPointerException - value is null
Method Detail

getScalarValue

public String getScalarValue()
Description copied from class: VariableValue
Get a simple string for this value

Only valid for string values

Overrides:
getScalarValue in class VariableValue
Returns:
the string

isEmpty

public boolean isEmpty()
Description copied from class: VariableValue
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.

Specified by:
isEmpty in class VariableValue
Returns:
true if the value is empty