Class DynamicTypeAdapterFactory<O extends K8sDynamicModel,L extends K8sDynamicModelsBase<O>>

java.lang.Object
org.jdrupes.vmoperator.common.DynamicTypeAdapterFactory<O,L>
Type Parameters:
O - the generic type
L - the generic type
All Implemented Interfaces:
com.google.gson.TypeAdapterFactory
Direct Known Subclasses:
K8sDynamicStub.K8sDynamicModelTypeAdapterFactory, VmDefinitionStub.VmDefintionModelTypeAdapterFactory

public class DynamicTypeAdapterFactory<O extends K8sDynamicModel,L extends K8sDynamicModelsBase<O>> extends Object implements com.google.gson.TypeAdapterFactory
A factory for creating objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DynamicTypeAdapterFactory(Class<O> objectClass, Class<L> objectListClass)
    Instantiates a new generic type adapter factory.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> com.google.gson.TypeAdapter<T>
    create(com.google.gson.Gson gson, com.google.gson.reflect.TypeToken<T> typeToken)
    Creates a type adapter for the given type.
    void
    register(io.kubernetes.client.openapi.ApiClient client)
    Make sure that this adapter is registered.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DynamicTypeAdapterFactory

      public DynamicTypeAdapterFactory(Class<O> objectClass, Class<L> objectListClass)
      Instantiates a new generic type adapter factory.
      Parameters:
      objectClass - the object class
      objectListClass - the object list class
  • Method Details

    • register

      public void register(io.kubernetes.client.openapi.ApiClient client)
      Make sure that this adapter is registered.
      Parameters:
      client - the client
    • create

      public <T> com.google.gson.TypeAdapter<T> create(com.google.gson.Gson gson, com.google.gson.reflect.TypeToken<T> typeToken)
      Creates a type adapter for the given type.
      Specified by:
      create in interface com.google.gson.TypeAdapterFactory
      Type Parameters:
      T - the generic type
      Parameters:
      gson - the gson
      typeToken - the type token
      Returns:
      the type adapter or null if the type is not handles by this factory