Class HashOps

java.lang.Object
net.minecraft.util.HashOps
All Implemented Interfaces:
DynamicOps<com.google.common.hash.HashCode>

public class HashOps extends Object implements DynamicOps<com.google.common.hash.HashCode>
  • Field Details

    • TAG_EMPTY

      private static final byte TAG_EMPTY
      See Also:
    • TAG_MAP_START

      private static final byte TAG_MAP_START
      See Also:
    • TAG_MAP_END

      private static final byte TAG_MAP_END
      See Also:
    • TAG_LIST_START

      private static final byte TAG_LIST_START
      See Also:
    • TAG_LIST_END

      private static final byte TAG_LIST_END
      See Also:
    • TAG_BYTE

      private static final byte TAG_BYTE
      See Also:
    • TAG_SHORT

      private static final byte TAG_SHORT
      See Also:
    • TAG_INT

      private static final byte TAG_INT
      See Also:
    • TAG_LONG

      private static final byte TAG_LONG
      See Also:
    • TAG_FLOAT

      private static final byte TAG_FLOAT
      See Also:
    • TAG_DOUBLE

      private static final byte TAG_DOUBLE
      See Also:
    • TAG_STRING

      private static final byte TAG_STRING
      See Also:
    • TAG_BOOLEAN

      private static final byte TAG_BOOLEAN
      See Also:
    • TAG_BYTE_ARRAY_START

      private static final byte TAG_BYTE_ARRAY_START
      See Also:
    • TAG_BYTE_ARRAY_END

      private static final byte TAG_BYTE_ARRAY_END
      See Also:
    • TAG_INT_ARRAY_START

      private static final byte TAG_INT_ARRAY_START
      See Also:
    • TAG_INT_ARRAY_END

      private static final byte TAG_INT_ARRAY_END
      See Also:
    • TAG_LONG_ARRAY_START

      private static final byte TAG_LONG_ARRAY_START
      See Also:
    • TAG_LONG_ARRAY_END

      private static final byte TAG_LONG_ARRAY_END
      See Also:
    • EMPTY_PAYLOAD

      private static final byte[] EMPTY_PAYLOAD
    • FALSE_PAYLOAD

      private static final byte[] FALSE_PAYLOAD
    • TRUE_PAYLOAD

      private static final byte[] TRUE_PAYLOAD
    • EMPTY_MAP_PAYLOAD

      public static final byte[] EMPTY_MAP_PAYLOAD
    • EMPTY_LIST_PAYLOAD

      public static final byte[] EMPTY_LIST_PAYLOAD
    • UNSUPPORTED_OPERATION_ERROR

      private static final DataResult<Object> UNSUPPORTED_OPERATION_ERROR
    • HASH_COMPARATOR

      private static final Comparator<com.google.common.hash.HashCode> HASH_COMPARATOR
    • MAP_ENTRY_ORDER

      private static final Comparator<Map.Entry<com.google.common.hash.HashCode, com.google.common.hash.HashCode>> MAP_ENTRY_ORDER
    • MAPLIKE_ENTRY_ORDER

      private static final Comparator<Pair<com.google.common.hash.HashCode, com.google.common.hash.HashCode>> MAPLIKE_ENTRY_ORDER
    • CRC32C_INSTANCE

      public static final HashOps CRC32C_INSTANCE
    • hashFunction

      private final com.google.common.hash.HashFunction hashFunction
    • empty

      private final com.google.common.hash.HashCode empty
    • emptyMap

      private final com.google.common.hash.HashCode emptyMap
    • emptyList

      private final com.google.common.hash.HashCode emptyList
    • trueHash

      private final com.google.common.hash.HashCode trueHash
    • falseHash

      private final com.google.common.hash.HashCode falseHash
  • Constructor Details

    • HashOps

      public HashOps(com.google.common.hash.HashFunction hashFunction)
  • Method Details

    • empty

      public com.google.common.hash.HashCode empty()
      Specified by:
      empty in interface DynamicOps<com.google.common.hash.HashCode>
    • emptyMap

      public com.google.common.hash.HashCode emptyMap()
      Specified by:
      emptyMap in interface DynamicOps<com.google.common.hash.HashCode>
    • emptyList

      public com.google.common.hash.HashCode emptyList()
      Specified by:
      emptyList in interface DynamicOps<com.google.common.hash.HashCode>
    • createNumeric

      public com.google.common.hash.HashCode createNumeric(Number value)
      Specified by:
      createNumeric in interface DynamicOps<com.google.common.hash.HashCode>
    • createByte

      public com.google.common.hash.HashCode createByte(byte value)
      Specified by:
      createByte in interface DynamicOps<com.google.common.hash.HashCode>
    • createShort

      public com.google.common.hash.HashCode createShort(short value)
      Specified by:
      createShort in interface DynamicOps<com.google.common.hash.HashCode>
    • createInt

      public com.google.common.hash.HashCode createInt(int value)
      Specified by:
      createInt in interface DynamicOps<com.google.common.hash.HashCode>
    • createLong

      public com.google.common.hash.HashCode createLong(long value)
      Specified by:
      createLong in interface DynamicOps<com.google.common.hash.HashCode>
    • createFloat

      public com.google.common.hash.HashCode createFloat(float value)
      Specified by:
      createFloat in interface DynamicOps<com.google.common.hash.HashCode>
    • createDouble

      public com.google.common.hash.HashCode createDouble(double value)
      Specified by:
      createDouble in interface DynamicOps<com.google.common.hash.HashCode>
    • createString

      public com.google.common.hash.HashCode createString(String value)
      Specified by:
      createString in interface DynamicOps<com.google.common.hash.HashCode>
    • createBoolean

      public com.google.common.hash.HashCode createBoolean(boolean value)
      Specified by:
      createBoolean in interface DynamicOps<com.google.common.hash.HashCode>
    • hashMap

      private static com.google.common.hash.Hasher hashMap(com.google.common.hash.Hasher hasher, Map<com.google.common.hash.HashCode, com.google.common.hash.HashCode> map)
    • hashMap

      private static com.google.common.hash.Hasher hashMap(com.google.common.hash.Hasher hasher, Stream<Pair<com.google.common.hash.HashCode, com.google.common.hash.HashCode>> map)
    • createMap

      public com.google.common.hash.HashCode createMap(Stream<Pair<com.google.common.hash.HashCode, com.google.common.hash.HashCode>> map)
      Specified by:
      createMap in interface DynamicOps<com.google.common.hash.HashCode>
    • createMap

      public com.google.common.hash.HashCode createMap(Map<com.google.common.hash.HashCode, com.google.common.hash.HashCode> map)
      Specified by:
      createMap in interface DynamicOps<com.google.common.hash.HashCode>
    • createList

      public com.google.common.hash.HashCode createList(Stream<com.google.common.hash.HashCode> input)
      Specified by:
      createList in interface DynamicOps<com.google.common.hash.HashCode>
    • createByteList

      public com.google.common.hash.HashCode createByteList(ByteBuffer input)
      Specified by:
      createByteList in interface DynamicOps<com.google.common.hash.HashCode>
    • createIntList

      public com.google.common.hash.HashCode createIntList(IntStream input)
      Specified by:
      createIntList in interface DynamicOps<com.google.common.hash.HashCode>
    • createLongList

      public com.google.common.hash.HashCode createLongList(LongStream input)
      Specified by:
      createLongList in interface DynamicOps<com.google.common.hash.HashCode>
    • remove

      public com.google.common.hash.HashCode remove(com.google.common.hash.HashCode input, String key)
      Specified by:
      remove in interface DynamicOps<com.google.common.hash.HashCode>
    • mapBuilder

      public RecordBuilder<com.google.common.hash.HashCode> mapBuilder()
      Specified by:
      mapBuilder in interface DynamicOps<com.google.common.hash.HashCode>
    • listBuilder

      public ListBuilder<com.google.common.hash.HashCode> listBuilder()
      Specified by:
      listBuilder in interface DynamicOps<com.google.common.hash.HashCode>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • convertTo

      public <U> U convertTo(DynamicOps<U> outOps, com.google.common.hash.HashCode input)
      Specified by:
      convertTo in interface DynamicOps<com.google.common.hash.HashCode>
    • getNumberValue

      public Number getNumberValue(com.google.common.hash.HashCode input, Number defaultValue)
      Specified by:
      getNumberValue in interface DynamicOps<com.google.common.hash.HashCode>
    • set

      public com.google.common.hash.HashCode set(com.google.common.hash.HashCode input, String key, com.google.common.hash.HashCode value)
      Specified by:
      set in interface DynamicOps<com.google.common.hash.HashCode>
    • update

      public com.google.common.hash.HashCode update(com.google.common.hash.HashCode input, String key, Function<com.google.common.hash.HashCode, com.google.common.hash.HashCode> function)
      Specified by:
      update in interface DynamicOps<com.google.common.hash.HashCode>
    • updateGeneric

      public com.google.common.hash.HashCode updateGeneric(com.google.common.hash.HashCode input, com.google.common.hash.HashCode key, Function<com.google.common.hash.HashCode, com.google.common.hash.HashCode> function)
      Specified by:
      updateGeneric in interface DynamicOps<com.google.common.hash.HashCode>
    • unsupported

      private static <T> DataResult<T> unsupported()
    • get

      public DataResult<com.google.common.hash.HashCode> get(com.google.common.hash.HashCode input, String key)
      Specified by:
      get in interface DynamicOps<com.google.common.hash.HashCode>
    • getGeneric

      public DataResult<com.google.common.hash.HashCode> getGeneric(com.google.common.hash.HashCode input, com.google.common.hash.HashCode key)
      Specified by:
      getGeneric in interface DynamicOps<com.google.common.hash.HashCode>
    • getNumberValue

      public DataResult<Number> getNumberValue(com.google.common.hash.HashCode input)
      Specified by:
      getNumberValue in interface DynamicOps<com.google.common.hash.HashCode>
    • getBooleanValue

      public DataResult<Boolean> getBooleanValue(com.google.common.hash.HashCode input)
      Specified by:
      getBooleanValue in interface DynamicOps<com.google.common.hash.HashCode>
    • getStringValue

      public DataResult<String> getStringValue(com.google.common.hash.HashCode input)
      Specified by:
      getStringValue in interface DynamicOps<com.google.common.hash.HashCode>
    • isEmpty

      private boolean isEmpty(com.google.common.hash.HashCode value)
    • mergeToList

      public DataResult<com.google.common.hash.HashCode> mergeToList(com.google.common.hash.HashCode prefix, com.google.common.hash.HashCode value)
      Description copied from interface: DynamicOps
      Only successful if first argument is a list/array or empty
      Specified by:
      mergeToList in interface DynamicOps<com.google.common.hash.HashCode>
    • mergeToList

      public DataResult<com.google.common.hash.HashCode> mergeToList(com.google.common.hash.HashCode prefix, List<com.google.common.hash.HashCode> values)
      Specified by:
      mergeToList in interface DynamicOps<com.google.common.hash.HashCode>
    • mergeToMap

      public DataResult<com.google.common.hash.HashCode> mergeToMap(com.google.common.hash.HashCode prefix, com.google.common.hash.HashCode key, com.google.common.hash.HashCode value)
      Description copied from interface: DynamicOps
      Only successful if first argument is a map or empty
      Specified by:
      mergeToMap in interface DynamicOps<com.google.common.hash.HashCode>
    • mergeToMap

      public DataResult<com.google.common.hash.HashCode> mergeToMap(com.google.common.hash.HashCode prefix, Map<com.google.common.hash.HashCode, com.google.common.hash.HashCode> values)
      Specified by:
      mergeToMap in interface DynamicOps<com.google.common.hash.HashCode>
    • mergeToMap

      public DataResult<com.google.common.hash.HashCode> mergeToMap(com.google.common.hash.HashCode prefix, MapLike<com.google.common.hash.HashCode> values)
      Specified by:
      mergeToMap in interface DynamicOps<com.google.common.hash.HashCode>
    • getMapValues

      public DataResult<Stream<Pair<com.google.common.hash.HashCode, com.google.common.hash.HashCode>>> getMapValues(com.google.common.hash.HashCode input)
      Specified by:
      getMapValues in interface DynamicOps<com.google.common.hash.HashCode>
    • getMapEntries

      public DataResult<Consumer<BiConsumer<com.google.common.hash.HashCode, com.google.common.hash.HashCode>>> getMapEntries(com.google.common.hash.HashCode input)
      Specified by:
      getMapEntries in interface DynamicOps<com.google.common.hash.HashCode>
    • getStream

      public DataResult<Stream<com.google.common.hash.HashCode>> getStream(com.google.common.hash.HashCode input)
      Specified by:
      getStream in interface DynamicOps<com.google.common.hash.HashCode>
    • getList

      public DataResult<Consumer<Consumer<com.google.common.hash.HashCode>>> getList(com.google.common.hash.HashCode input)
      Specified by:
      getList in interface DynamicOps<com.google.common.hash.HashCode>
    • getMap

      public DataResult<MapLike<com.google.common.hash.HashCode>> getMap(com.google.common.hash.HashCode input)
      Specified by:
      getMap in interface DynamicOps<com.google.common.hash.HashCode>
    • getByteBuffer

      public DataResult<ByteBuffer> getByteBuffer(com.google.common.hash.HashCode input)
      Specified by:
      getByteBuffer in interface DynamicOps<com.google.common.hash.HashCode>
    • getIntStream

      public DataResult<IntStream> getIntStream(com.google.common.hash.HashCode input)
      Specified by:
      getIntStream in interface DynamicOps<com.google.common.hash.HashCode>
    • getLongStream

      public DataResult<LongStream> getLongStream(com.google.common.hash.HashCode input)
      Specified by:
      getLongStream in interface DynamicOps<com.google.common.hash.HashCode>