Package net.minecraft.server.network
Record Class Filterable<T>
java.lang.Object
java.lang.Record
net.minecraft.server.network.Filterable<T>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFilterable
(T raw, Optional<T> filtered) Creates an instance of aFilterable
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> com.mojang.serialization.Codec
<Filterable<T>> codec
(com.mojang.serialization.Codec<T> p_331745_) final boolean
Indicates whether some other object is "equal to" this one.filtered()
Returns the value of thefiltered
record component.static Filterable
<String> from
(FilteredText p_330414_) get
(boolean p_331777_) final int
hashCode()
Returns a hash code value for this object.<U> Filterable
<U> static <T> Filterable
<T> passThrough
(T p_330890_) raw()
Returns the value of theraw
record component.<U> Optional
<Filterable<U>> static <B extends io.netty.buffer.ByteBuf,
T>
StreamCodec<B, Filterable<T>> streamCodec
(StreamCodec<B, T> p_330521_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
raw
The field for theraw
record component. -
filtered
The field for thefiltered
record component.
-
-
Constructor Details
-
Filterable
Creates an instance of aFilterable
record class.- Parameters:
raw
- the value for theraw
record componentfiltered
- the value for thefiltered
record component
-
-
Method Details
-
codec
public static <T> com.mojang.serialization.Codec<Filterable<T>> codec(com.mojang.serialization.Codec<T> p_331745_) -
streamCodec
public static <B extends io.netty.buffer.ByteBuf,T> StreamCodec<B,Filterable<T>> streamCodec(StreamCodec<B, T> p_330521_) -
passThrough
-
from
-
get
-
map
-
resolve
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
raw
Returns the value of theraw
record component.- Returns:
- the value of the
raw
record component
-
filtered
Returns the value of thefiltered
record component.- Returns:
- the value of the
filtered
record component
-