Class ConstantSelector<T>
java.lang.Object
com.pixelmonmod.pixelmon.api.selector.type.ConstantSelector<T>
- Type Parameters:
T- The type being selected
This represents an implementation of
Selector
where it will only ever give one value-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<A> Function<com.mojang.serialization.Codec<A>,com.mojang.serialization.Codec<? extends Selector<A>>> codec()Gets the codec for this selectorstatic <A> com.mojang.serialization.Codec<ConstantSelector<A>>codec(com.mojang.serialization.Codec<A> codec) Factory for creating an instanced version of this classGets a random elementiterator()static <T> ConstantSelector<T>of(T value) Creates a new instance of the ConstantSelector with the given valueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
value
-
-
Constructor Details
-
ConstantSelector
-
-
Method Details
-
of
Creates a new instance of the ConstantSelector with the given value- Type Parameters:
T- The type- Parameters:
value- The value to use- Returns:
- The new instance
-
getRandom
Description copied from interface:SelectorGets a random element -
iterator
-
codec
public static <A> com.mojang.serialization.Codec<ConstantSelector<A>> codec(com.mojang.serialization.Codec<A> codec) Factory for creating an instanced version of this class- Type Parameters:
A- The type- Parameters:
codec- The type's codec- Returns:
- The codec for the instanced selector
-
codec
public <A> Function<com.mojang.serialization.Codec<A>,com.mojang.serialization.Codec<? extends Selector<A>>> codec()Description copied from interface:SelectorGets the codec for this selector
-