T- the Java type of serialized / deserialized instances.
public interface Type<T>
TypeNameto identify the type.
TypeSerializerfor serializing and deserializing instances of the type.
StateFun's type system has cross-language support for common primitive types, such as boolean,
integer, long, etc. These primitive types have built-in
Types implemented for them
already, with predefined
This is of course all transparent for the user, so you don't need to worry about it. Functions implemented in various languages (e.g. Java or Python) can message each other by directly sending supported primitive values as message arguments. Moreover, the type system is used for state values as well; so, you can expect that a function can safely read previous state after reimplementing it in a different language.
The type system is also very easily extensible to support custom message types, such as JSON
or Protobuf messages. This is just a matter of implementing your own
Type with a custom
typename and serializer. Alternatively, you can also use the
SimpleType class to do this
|Modifier and Type||Method and Description|
TypeSerializerthat can serialize and deserialize this type.
default java.util.Set<TypeCharacteristics> typeCharacteristics()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.