Record Class Filterable<T>

java.lang.Object
java.lang.Record
net.minecraft.server.network.Filterable<T>

public record Filterable<T>(T raw, Optional<T> filtered) extends Record
  • Field Details

    • raw

      private final T raw
      The field for the raw record component.
    • filtered

      private final Optional<T> filtered
      The field for the filtered record component.
  • Constructor Details

    • Filterable

      public Filterable(T raw, Optional<T> filtered)
      Creates an instance of a Filterable record class.
      Parameters:
      raw - the value for the raw record component
      filtered - the value for the filtered 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

      public static <T> Filterable<T> passThrough(T p_330890_)
    • from

      public static Filterable<String> from(FilteredText p_330414_)
    • get

      public T get(boolean p_331777_)
    • map

      public <U> Filterable<U> map(Function<T,U> p_331765_)
    • resolve

      public <U> Optional<Filterable<U>> resolve(Function<T,Optional<U>> p_330635_)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • raw

      public T raw()
      Returns the value of the raw record component.
      Returns:
      the value of the raw record component
    • filtered

      public Optional<T> filtered()
      Returns the value of the filtered record component.
      Returns:
      the value of the filtered record component