BUG-5222: Optimize use of declared substatements
[yangtools.git] / third-party / triemap / src / main / java / com / romix / scala / Option.java
1 package com.romix.scala;
2
3 /**
4  * Mimic Option in Scala
5  *  
6  * @author Roman Levenstein <romixlev@gmail.com>
7  *
8  * @param <V>
9  */
10 @SuppressWarnings({"rawtypes", "unchecked"})
11 public class Option<V> {
12     static None none = new None();
13     public static <V> Option<V> makeOption(V o){
14         if(o!=null)
15             return new Some<V>(o);
16         else
17             return (Option<V>)none;
18     }
19
20     public static <V> Option<V> makeOption(){
21         return (Option<V>)none;
22     }
23     public boolean nonEmpty () {
24         return false;
25     }
26 }