Interface KubeJSCodecUtil


public interface KubeJSCodecUtil
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static <E extends Enum<E> & net.minecraft.util.StringRepresentable>
    E
    byName(com.mojang.serialization.Codec<E> codec, String s)
     
    static <T> boolean
    filter(com.mojang.serialization.DataResult<T> result, Predicate<T> ifSuccess)
     
    static <T> boolean
    filter(com.mojang.serialization.DataResult<T> result, Predicate<T> ifSuccess, boolean orElse)
     
    static <E> E
    fromJsonOrThrow(com.google.gson.JsonElement json, com.mojang.serialization.Codec<E> codec)
     
    static <E, X extends Throwable>
    E
    fromJsonOrThrow(com.google.gson.JsonElement json, com.mojang.serialization.Codec<E> codec, Function<String,X> onError)
     
    static <T> String
    getUniqueId(T input, com.mojang.serialization.Codec<T> codec)
     
    static <T> com.mojang.serialization.Codec<List<T>>
    listOfOrSelf(com.mojang.serialization.Codec<List<T>> listCodec, com.mojang.serialization.Codec<T> codec)
     
    static <T> com.mojang.serialization.Codec<List<T>>
    listOfOrSelf(com.mojang.serialization.Codec<T> codec)
     
    static com.mojang.serialization.Codec<Long>
    longRangeWithMessage(long min, long max, Function<Long,String> errorMessage)
     
    static com.google.gson.JsonElement
    numberProviderJson(net.minecraft.world.level.storage.loot.providers.number.NumberProvider gen)
     
    static <V> com.mojang.serialization.Codec<V>
    or(com.mojang.serialization.Codec<? extends V> first, com.mojang.serialization.Codec<? extends V> second)
     
    static <V> com.mojang.serialization.Codec<V>
    or(List<com.mojang.serialization.Codec<? extends V>> codecs)
     
    static <E> com.mojang.serialization.Codec<E>
    stringResolverCodec(Function<E,String> toStringFunction, Function<String,E> fromStringFunction)
     
    static <E> com.google.gson.JsonElement
    toJsonOrThrow(E value, com.mojang.serialization.Codec<E> codec)
     
    static <E, X extends Throwable>
    com.google.gson.JsonElement
    toJsonOrThrow(E value, com.mojang.serialization.Codec<E> codec, Function<String,X> onError)
     
  • Method Details

    • stringResolverCodec

      static <E> com.mojang.serialization.Codec<E> stringResolverCodec(Function<E,String> toStringFunction, Function<String,E> fromStringFunction)
    • byName

      static <E extends Enum<E> & net.minecraft.util.StringRepresentable> E byName(com.mojang.serialization.Codec<E> codec, String s)
    • fromJsonOrThrow

      static <E> E fromJsonOrThrow(com.google.gson.JsonElement json, com.mojang.serialization.Codec<E> codec)
    • toJsonOrThrow

      static <E> com.google.gson.JsonElement toJsonOrThrow(E value, com.mojang.serialization.Codec<E> codec)
    • fromJsonOrThrow

      static <E, X extends Throwable> E fromJsonOrThrow(com.google.gson.JsonElement json, com.mojang.serialization.Codec<E> codec, Function<String,X> onError) throws X
      Throws:
      X
    • toJsonOrThrow

      static <E, X extends Throwable> com.google.gson.JsonElement toJsonOrThrow(E value, com.mojang.serialization.Codec<E> codec, Function<String,X> onError) throws X
      Throws:
      X
    • getUniqueId

      static <T> String getUniqueId(T input, com.mojang.serialization.Codec<T> codec)
    • numberProviderJson

      static com.google.gson.JsonElement numberProviderJson(net.minecraft.world.level.storage.loot.providers.number.NumberProvider gen)
    • listOfOrSelf

      static <T> com.mojang.serialization.Codec<List<T>> listOfOrSelf(com.mojang.serialization.Codec<T> codec)
    • listOfOrSelf

      static <T> com.mojang.serialization.Codec<List<T>> listOfOrSelf(com.mojang.serialization.Codec<List<T>> listCodec, com.mojang.serialization.Codec<T> codec)
    • or

      static <V> com.mojang.serialization.Codec<V> or(List<com.mojang.serialization.Codec<? extends V>> codecs)
    • or

      static <V> com.mojang.serialization.Codec<V> or(com.mojang.serialization.Codec<? extends V> first, com.mojang.serialization.Codec<? extends V> second)
    • longRangeWithMessage

      static com.mojang.serialization.Codec<Long> longRangeWithMessage(long min, long max, Function<Long,String> errorMessage)
    • filter

      static <T> boolean filter(com.mojang.serialization.DataResult<T> result, Predicate<T> ifSuccess)
    • filter

      static <T> boolean filter(com.mojang.serialization.DataResult<T> result, Predicate<T> ifSuccess, boolean orElse)