package com.enderio.core.common.util;

import javax.annotation.concurrent.Immutable;

import lombok.AllArgsConstructor;
import lombok.Value;
import lombok.experimental.Wither;

/**
 * An object to represent a bounds limit on a property.
 * 
 * @param <T>
 *            The type of the bound.
 */
@Immutable
@Value
@AllArgsConstructor(staticName = "of")
public class Bound<T extends Number & Comparable<T>>
{
    public static final Bound<Double> MAX_BOUND = Bound.of(Double.MIN_VALUE, Double.MAX_VALUE);

    @Wither
    public T min, max;

    public T clamp(T val)
    {
        return val.compareTo(min) < 0 ? min : val.compareTo(max) > 0 ? max : val;
    }
}
@@ -83,42 +83,8 @@
 e;%0A%0A
-import lombok.AllArgsConstructor;%0A
 impo
@@ -226,18 +226,16 @@
         
-  
 The type
@@ -271,16 +271,18 @@
 %0A@Value%0A
+//
 @AllArgs
@@ -311,16 +311,44 @@
  = %22of%22)
+ // Broken with javac 1.8...
 %0Apublic 
@@ -396,13 +396,11 @@
 %3CT%3E%3E
-%0A
+ 
 %7B%0A
-  
   pu
@@ -490,18 +490,16 @@
 ALUE);%0A%0A
-  
   @Withe
@@ -506,32 +506,147 @@
 r%0A  
-  
 public 
+T min, max;%0A%0A  public static %3CT extends Number & Comparable%3CT%3E%3E Bound%3CT%3E of(
 T min,
+ T
  max
-;%0A%0A  
+) %7B%0A    return new Bound%3CT%3E(min, max);%0A  %7D%0A%0A
   pu
@@ -668,19 +668,11 @@
 val)
-%0A    %7B%0A    
+ %7B%0A
     
@@ -745,15 +745,13 @@
  : val;%0A
-  
   %7D%0A%7D

Fix compilation issues