From f048dcf8b8dae56c72395512a1f6288d0d6ff7e9 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Tue, 5 May 2015 10:35:01 -0400 Subject: [PATCH] Fix compilation issues --- .../com/enderio/core/common/util/Bound.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/enderio/core/common/util/Bound.java b/src/main/java/com/enderio/core/common/util/Bound.java index 0dd31a7..ebd24a8 100644 --- a/src/main/java/com/enderio/core/common/util/Bound.java +++ b/src/main/java/com/enderio/core/common/util/Bound.java @@ -2,7 +2,6 @@ package com.enderio.core.common.util; import javax.annotation.concurrent.Immutable; -import lombok.AllArgsConstructor; import lombok.Value; import lombok.experimental.Wither; @@ -10,20 +9,22 @@ import lombok.experimental.Wither; * An object to represent a bounds limit on a property. * * @param - * The type of the bound. + * The type of the bound. */ @Immutable @Value -@AllArgsConstructor(staticName = "of") -public class Bound> -{ - public static final Bound MAX_BOUND = Bound.of(Double.MIN_VALUE, Double.MAX_VALUE); +//@AllArgsConstructor(staticName = "of") // Broken with javac 1.8... +public class Bound> { + public static final Bound MAX_BOUND = Bound.of(Double.MIN_VALUE, Double.MAX_VALUE); - @Wither - public T min, max; + @Wither + public T min, max; - public T clamp(T val) - { - return val.compareTo(min) < 0 ? min : val.compareTo(max) > 0 ? max : val; - } + public static > Bound of(T min, T max) { + return new Bound(min, max); + } + + public T clamp(T val) { + return val.compareTo(min) < 0 ? min : val.compareTo(max) > 0 ? max : val; + } } \ No newline at end of file