blob: cb074d9a9006f3f3ac8d6fce0c5b0798e6d72c10 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/*
* Copyright (c) 2018, 2019, 2020 shedaniel
* Licensed under the MIT License (the "License").
*/
package me.shedaniel.rei.api;
import me.shedaniel.rei.impl.ObjectHolderImpl;
import org.jetbrains.annotations.ApiStatus;
public interface ObjectHolder<T> {
@SuppressWarnings("deprecation")
static <T> ObjectHolder<T> of(T o) {
return new ObjectHolderImpl<>(o);
}
@Deprecated
@ApiStatus.ScheduledForRemoval
default int intValue() {
return (int) (Object) value();
}
@Deprecated
@ApiStatus.ScheduledForRemoval
default long longValue() {
return (long) (Object) value();
}
@Deprecated
@ApiStatus.ScheduledForRemoval
default boolean booleanValue() {
return (boolean) (Object) value();
}
@Deprecated
@ApiStatus.ScheduledForRemoval
default float floatValue() {
return (float) (Object) value();
}
@Deprecated
@ApiStatus.ScheduledForRemoval
default double doubleValue() {
return (double) (Object) value();
}
@Deprecated
@ApiStatus.ScheduledForRemoval
default String stringValue() {
return (String) value();
}
T value();
}
|