Maven module :un.api : api-common :
Class : un.api.lang.Option
Extends/Implements : -
Subclasses : -

An optional value.
author  Yann D'Isanto


Variables : NONE
Functions : get, isDefined, isEmpty, getOrElse, some, none



The undefined optional value
public Option NONE


public Object get ()


return  true if this value is defined.
public boolean isDefined ()


return  true is this value is empty (not defined).
public boolean isEmpty ()


param  defaultValue the default value to return if not defined.
return  this value if defined, the specified default value otherwise.
public Object getOrElse (Object defaultValue)


Creates an optional value.
param  value the value.
return  an optional value, NONE if value is null.
public Option some (Object value)


return  the NONE optional value (value is null).
public Option none ()