org.kinotic.continuum.idl.api.converter.IdlConverterStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of continuum-idl Show documentation
Show all versions of continuum-idl Show documentation
A Microservice and IOT framework for everyone!
package org.kinotic.continuum.idl.api.converter;
import org.kinotic.continuum.idl.api.schema.C3Type;
import java.util.Set;
/**
* The {@link IdlConverterStrategy} is used to determine how to convert a Continuum IDL to a specific language type.
* The {@link IdlConverterStrategy} should be reusable and thread safe.
*
* @param The type to convert to
* @param The state type
*s4/26/23.
*/
public interface IdlConverterStrategy {
/**
* Returns the {@link C3TypeConverter}s that are supported by this strategy.
* @return the supported {@link C3TypeConverter}s
*/
Set> converters();
/**
* The object that will be available via the {@link C3ConversionContext#state()}.
* This can be a simple {@link java.util.Map} or something with better type safety.
* This should return a new instance each time it is called.
* This will be called each time a new {@link C3ConversionContext} is created.
* @return the conversion context state.
*/
S initialState();
/**
* Determines if caching is turned on for this strategy.
* If shouldCache is true and the {@link C3TypeConverter} extends {@link Cacheable} then the results of the conversion will be cached and reused
* @return true if the results of the converts should be cached
*/
boolean shouldCache();
}