Class ValueAdapterRegistry

java.lang.Object
cc.carm.lib.configuration.adapter.ValueAdapterRegistry

public class ValueAdapterRegistry extends Object
  • Field Details

  • Constructor Details

    • ValueAdapterRegistry

      public ValueAdapterRegistry()
  • Method Details

    • register

      public <FROM, TO> void register(@NotNull @NotNull Class<FROM> from, @NotNull @NotNull Class<TO> to, @Nullable @Nullable DataFunction<FROM,TO> parser, @Nullable @Nullable DataFunction<TO,FROM> serializer)
    • register

      public <FROM, TO> void register(@NotNull @NotNull ValueType<FROM> from, @NotNull @NotNull ValueType<TO> to, @Nullable @Nullable DataFunction<FROM,TO> parser, @Nullable @Nullable DataFunction<TO,FROM> serializer)
    • register

      public void register(@NotNull @NotNull ValueAdapter<?>... adapter)
    • register

      public <T> void register(@NotNull @NotNull Class<T> type, @NotNull @NotNull ValueSerializer<T> serializer)
    • register

      public <T> void register(@NotNull @NotNull ValueType<T> type, @NotNull @NotNull ValueSerializer<T> serializer)
    • register

      public <T> void register(@NotNull @NotNull Class<T> type, @NotNull @NotNull ValueParser<T> deserializer)
    • register

      public <T> void register(@NotNull @NotNull ValueType<T> type, @NotNull @NotNull ValueParser<T> deserializer)
    • register

      public <T> void register(@NotNull @NotNull ValueType<T> type, @Nullable @Nullable ValueSerializer<T> serializer, @Nullable @Nullable ValueParser<T> deserializer)
    • unregister

      public void unregister(@NotNull @NotNull Class<?> type)
    • unregister

      public void unregister(@NotNull @NotNull ValueType<?> type)
    • adapterOf

      @Nullable public <T> @Nullable ValueAdapter<T> adapterOf(@NotNull @NotNull ValueType<T> type)
    • adapterOf

      public <T> ValueAdapter<T> adapterOf(@NotNull T value)
    • adapterOf

      public <T> ValueAdapter<T> adapterOf(@NotNull @NotNull Class<T> type)
    • deserialize

      public <T> T deserialize(@NotNull @NotNull ConfigurationHolder<?> holder, @NotNull @NotNull Class<T> type, @Nullable @Nullable Object source) throws Exception
      Throws:
      Exception
    • deserialize

      public <T> T deserialize(@NotNull @NotNull ConfigurationHolder<?> holder, @NotNull @NotNull ValueType<T> type, @Nullable @Nullable Object source) throws Exception
      Throws:
      Exception
    • serialize

      @Nullable public <T> @Nullable Object serialize(@NotNull @NotNull ConfigurationHolder<?> holder, @Nullable T value) throws Exception
      Throws:
      Exception
    • deserializeList

      protected <T> List<T> deserializeList(@NotNull @NotNull ConfigurationHolder<?> holder, @NotNull @NotNull ValueType<T> type, @Nullable @Nullable Object source) throws Exception
      Throws:
      Exception