Package org.eolang
Class Dataized
- java.lang.Object
-
- org.eolang.Dataized
-
public final class Dataized extends Object
A dataized object.The class automates the process of turning EO objects into data. The mechanism is explained in details in our canonical paper. Simply put, it makes an attempt to either type-cast the provided object into data or find "Δ" attribute inside it. If neither of that works, there is a runtime exception.
- Since:
- 0.1
- See Also:
- Canonical explanation of the Dataization concept
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanasBool()Extract the data from the object and convert to boolean.BytesasBytes()Extract the data from the object and convert toBytes.DoubleasNumber()Extract the data from the object and convert to number.StringasString()Extract the data from the object and convert to string.byte[]take()Extract the data from the object.<T> Ttake(Class<T> type)Take the data with a type.
-
-
-
Method Detail
-
take
public byte[] take()
Extract the data from the object.- Returns:
- The data
-
take
public <T> T take(Class<T> type)
Take the data with a type.- Type Parameters:
T- The type- Parameters:
type- The type- Returns:
- The data
-
asString
public String asString()
Extract the data from the object and convert to string.- Returns:
- Data as string
-
asNumber
public Double asNumber()
Extract the data from the object and convert to number.- Returns:
- Data as number
-
asBool
public Boolean asBool()
Extract the data from the object and convert to boolean.- Returns:
- Data as boolean
-
-