mirror of
https://github.com/GTNewHorizons/EnderCore.git
synced 2026-11-18 19:29:09 +00:00
Fix compilation issues
This commit is contained in:
1 parent
ed514c78cc
commit
f048dcf8b8
1 file changed
+13
-12
@@ -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 <T>
|
||||
* The type of the bound.
|
||||
* 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);
|
||||
//@AllArgsConstructor(staticName = "of") // Broken with javac 1.8...
|
||||
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;
|
||||
@Wither
|
||||
public T min, max;
|
||||
|
||||
public T clamp(T val)
|
||||
{
|
||||
return val.compareTo(min) < 0 ? min : val.compareTo(max) > 0 ? max : val;
|
||||
}
|
||||
public static <T extends Number & Comparable<T>> Bound<T> of(T min, T max) {
|
||||
return new Bound<T>(min, max);
|
||||
}
|
||||
|
||||
public T clamp(T val) {
|
||||
return val.compareTo(min) < 0 ? min : val.compareTo(max) > 0 ? max : val;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user