Class KeystrokeKey.Serializer
java.lang.Object
com.inductiveautomation.factorypmi.application.script.KeystrokeKey.Serializer
- All Implemented Interfaces:
ResourceAttributeSerializer<KeystrokeKey>
- Enclosing class:
- KeystrokeKey
public static class KeystrokeKey.Serializer
extends Object
implements ResourceAttributeSerializer<KeystrokeKey>
Gson adapter for serializing and deserializing
KeystrokeKey
objects.
This class is used to convert KeystrokeKey
instances to JSON format and back,
facilitating the handling of keystroke key attributes in resources.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecodeFromResource
(Resource resource) Decodes the given object from the provided Resource by extracting its attribute fields.Encodes the given object into resource attribute fields.
-
Constructor Details
-
Serializer
public Serializer()
-
-
Method Details
-
encodeToResource
Description copied from interface:ResourceAttributeSerializer
Encodes the given object into resource attribute fields.- Specified by:
encodeToResource
in interfaceResourceAttributeSerializer<KeystrokeKey>
- Parameters:
key
- the object to encode- Returns:
- a Consumer that modifies the ResourceBuilder by setting the relevant attributes of the given object
-
decodeFromResource
Description copied from interface:ResourceAttributeSerializer
Decodes the given object from the provided Resource by extracting its attribute fields.- Specified by:
decodeFromResource
in interfaceResourceAttributeSerializer<KeystrokeKey>
- Parameters:
resource
- the resource object from which the object should be decoded- Returns:
- the decoded object
-