org.littleshoot.util
Class SomeImpl<T>

java.lang.Object
  extended by org.littleshoot.util.SomeImpl<T>
Type Parameters:
T - The type of object this optional object holds.
All Implemented Interfaces:
Serializable, Optional<T>, Some<T>

public final class SomeImpl<T>
extends Object
implements Some<T>, Serializable

An implementation of the Some interface.

See Also:
Serialized Form

Constructor Summary
SomeImpl(T object)
          Constructs a new optional object with some object value.
 
Method Summary
<ReturnT> ReturnT
accept(OptionalVisitor<ReturnT,T> visitor)
          Accepts a visitor to this optional object.
 boolean equals(Object other)
          
 T object()
          Returns the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SomeImpl

public SomeImpl(T object)
Constructs a new optional object with some object value.

Parameters:
object - The object value.
Method Detail

object

public T object()
Returns the object.

Specified by:
object in interface Some<T>
Returns:
The object.

accept

public <ReturnT> ReturnT accept(OptionalVisitor<ReturnT,T> visitor)
Accepts a visitor to this optional object.

Specified by:
accept in interface Optional<T>
Type Parameters:
ReturnT - The type returned by the visitor.
Parameters:
visitor - The visitor.
Returns:
The result of visiting this optional object with the given visitor.

equals

public boolean equals(Object other)

Overrides:
equals in class Object


Copyright © 2011-2013 LittleShoot. All Rights Reserved.