@Test void testCodecSerializer() throws ObjectMappingException { final TypeSerializerCollection serializers = TypeSerializerCollection.defaults().childBuilder() .register(VEC3I_TYPE, DfuSerializers.forCodec(VEC3I_CODEC)) .build(); final ConfigurationNode testElement = BasicConfigurationNode.root(ConfigurationOptions.defaults().withSerializers(serializers), n -> { n.appendListNode().setValue(4); n.appendListNode().setValue(5); n.appendListNode().setValue(8); }); final Vector3i pos = testElement.getValue(VEC3I_TYPE); assertEquals(new Vector3i(4, 5, 8), pos); }
public static <V> TypeSerializer<V> forCodec(final Codec<V> codec) { return new CodecSerializer<>(requireNonNull(codec, "codec")); }
DfuSerializers { public static <V> TypeSerializer<V> forCodec(final Codec<V> codec) { return new CodecSerializer<>(requireNonNull(codec, "codec")); } }
DfuSerializers { public static <V> TypeSerializer<V> forCodec(final Codec<V> codec) { return new CodecSerializer<>(requireNonNull(codec, "codec")); } private  DfuSerializers(); }
DfuSerializers { public static <V> TypeSerializer<V> forCodec(final Codec<V> codec) { return new CodecSerializer<>(requireNonNull(codec, "codec")); } private  DfuSerializers(); static TypeSerializer<V> forCodec(final Codec<V> codec); static Codec<S> forSerializer(final TypeToken<S> type); static Codec<V> forSerializer(final TypeToken<V> type, final TypeSerializerCollection collection); }
DfuSerializers { public static <V> TypeSerializer<V> forCodec(final Codec<V> codec) { return new CodecSerializer<>(requireNonNull(codec, "codec")); } private  DfuSerializers(); static TypeSerializer<V> forCodec(final Codec<V> codec); static Codec<S> forSerializer(final TypeToken<S> type); static Codec<V> forSerializer(final TypeToken<V> type, final TypeSerializerCollection collection);  }