Class MapHasher<Type>
java.lang.Object
com.zenith.mc.item.hashing.MapHasher<Type>
- Type Parameters:
Type- the type thisMapHasherencodes.
-
Method Summary
Modifier and TypeMethodDescriptionaccept(MapBuilder<Type> builder) Applies theMapBuilderto thisMapHasher, essentially adding all the keys it defines here.accept(MapBuilder<Value> builder, Function<Type, Value> extractor) Extracts aValuefrom aTypeusing theextractor, and applies the givenMapBuilderfor it to thisMapHasher, essentially adding the keys it defines here.accept(String key, MinecraftHasher<Value> hasher, Function<Type, Value> extractor) Extracts aValuefrom aTypeusing theextractor, then dispatches aMapBuilderfrom theValueusing thebuilderDispatcher, and applies it to thisMapHasher, essentially adding the keys it defines here.acceptConstant(String key, MinecraftHasher<Value> hasher, Value value) Adds a constantValueto the map.acceptList(String key, MinecraftHasher<Value> valueHasher, Function<Type, List<Value>> extractor) com.google.common.hash.HashCodebuild()optional(String key, MinecraftHasher<Value> hasher, Function<Type, Value> extractor, Value defaultValue) optionalList(String key, MinecraftHasher<Value> valueHasher, Function<Type, List<Value>> extractor) optionalNullable(String key, MinecraftHasher<Value> hasher, Function<Type, Value> extractor)
-
Method Details
-
acceptConstant
-
accept
-
accept
Applies theMapBuilderto thisMapHasher, essentially adding all the keys it defines here. -
accept
Extracts aValuefrom aTypeusing theextractor, and applies the givenMapBuilderfor it to thisMapHasher, essentially adding the keys it defines here.- Type Parameters:
Value- the type of the value.- Parameters:
builder- theMapBuilderthat encodes aValue.extractor- the function that extracts aValuefrom aType.
-
accept
public <Value> MapHasher<Type> accept(Function<Type, Value> extractor, Function<Value, MapBuilder<Type>> builderDispatcher) Extracts aValuefrom aTypeusing theextractor, then dispatches aMapBuilderfrom theValueusing thebuilderDispatcher, and applies it to thisMapHasher, essentially adding the keys it defines here.- Type Parameters:
Value- the type of the value.- Parameters:
extractor- the function that extracts aValuefrom aType.builderDispatcher- the function that dispatches aMapBuilderfrom aValue.
-
optionalNullable
-
optional
-
optional
-
acceptList
-
optionalList
-
build
public com.google.common.hash.HashCode build()
-