com.endeca.navigation
Class OptionalBoolean

java.lang.Object
  extended by com.endeca.navigation.OptionalBoolean

public class OptionalBoolean
extends Object

Class representing an boolean or an unset value. Unlike an boolean, an OptionalBoolean may be empty.


Constructor Summary
OptionalBoolean()
          Default constructor that creates an empty OptionalBoolean object.
OptionalBoolean(boolean val)
          Constructor specifying an boolean.
 
Method Summary
 boolean getBoolean()
          Accessor that returns the boolean of this OptionalBoolean.
 boolean isEmpty()
          Returns whether this OptionalBoolean is empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionalBoolean

public OptionalBoolean()
Default constructor that creates an empty OptionalBoolean object.


OptionalBoolean

public OptionalBoolean(boolean val)
Constructor specifying an boolean.

Parameters:
val - The value of the boolean the OptionalInt holds.
Method Detail

getBoolean

public boolean getBoolean()
                   throws NoSuchElementException
Accessor that returns the boolean of this OptionalBoolean.

Returns:
The boolean of this OptionalBoolean.
Throws:
NoSuchElementException

isEmpty

public boolean isEmpty()
Returns whether this OptionalBoolean is empty.

Returns:
Whether this OptionalBoolean is empty.


© 2003, 2012 Oracle and/or its affiliates. All rights reserved.
Oracle and/or its affiliates Confidential