Optional should really be a closed type, as it's basically an
algebraic datatype, something like:

abstract class Option<T> {
  private Option() { }
  static final class None<T> extends Option<T> { }
  static final class Some<T> extends Option<T> { ... }
}

I would not expect it to be something you can subtype as a third party.

On Fri, Oct 26, 2012 at 1:18 PM, clay <[email protected]> wrote:
> Using the latest lambda build, I just tried to write:
>
> public class FixedOptional<T> extends Optional<T> implements Iterable
>
> which may be arguably better than using one of the many existing excellent
> independent implementations (Functional Java, Atlassian).
>
> Unfortunately the none/empty constructor is private so I can't create a
> derived version.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Java Posse" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/javaposse/-/1zKVOHHJeXYJ.
>
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Java 
Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to