Package io.patriot_framework.generator
Class Data
- java.lang.Object
-
- io.patriot_framework.generator.Data
-
public class Data extends Object
Class provides simple tool to store data in different data types. To give users freedom in designing Devices and DataFeeds library offers Data structure to save and safety manipulate with generated data.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
get(Class<T> clazz)
Gets data saved within Data instance with desired type.<T> T
set(T obj, Class<T> clazz)
SetterString
toString()
-
-
-
Method Detail
-
get
public <T> T get(Class<T> clazz)
Gets data saved within Data instance with desired type. If their type is not castable to provided Class, method throws IllegalCastException.- Type Parameters:
T
- type of class to be used- Parameters:
clazz
- class used to retype the object to- Returns:
- retyped stored value to new class
-
set
public <T> T set(T obj, Class<T> clazz)
Setter- Type Parameters:
T
- type of class- Parameters:
obj
- object to be setclazz
- class of object to be set- Returns:
- retyped object, which was set to target class
-
-