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