Package cronapi
Class Var
java.lang.Object
cronapi.Var
- All Implemented Interfaces:
com.fasterxml.jackson.databind.JsonSerializable,Variable,Serializable,Comparable<Var>,org.apache.olingo.odata2.core.ep.producer.OlingoJsonSerializer,VirtualClassInterface
public class Var
extends Object
implements Comparable<Var>, com.fasterxml.jackson.databind.JsonSerializable, org.apache.olingo.odata2.core.ep.producer.OlingoJsonSerializer, VirtualClassInterface, Variable, Serializable
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.fasterxml.jackson.databind.JsonSerializable
com.fasterxml.jackson.databind.JsonSerializable.Base -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String[]static final Object[]static final ScriptEnginestatic final Stringstatic final ScriptEngineManagerstatic final Patternstatic Class[]static final Varstatic final Varstatic final Varstatic final Varstatic final Varstatic final Varstatic final Varstatic final Var -
Constructor Summary
ConstructorsConstructorDescriptionVar()Construct a Var with an NULL typeConstruct a Var from a given VarConstruct a Var and assign its contained object to that specified.Construct a Var and assign its contained object to that specified. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd all values from one List to another.static Object[]asObjectArray(Var[] vars) Clone ObjectintCompare this object's value to anotherbooleancontainsKey(String name) static Objectdeserialize(String value) static StringdeserializeType(String value) booleanTest to see if this object equals another one.static Varget(int index) If this object is a linked list, then calling this method will return the Var at the index indicatedgetId()getMD5()Get object as an boolean.byte[]Get object as a byte array.Get the contained datasourceGet object as an boolean.Get object as a double.Get object as an int.com.google.gson.JsonElementcom.google.gson.JsonElementGet the object as a list.Get object as an int.getObjectAsRawList(Class clazz) Get object as a string.getObjectAsVarList(Class clazz) getPOJO()getStringField(String field) getType()Get the type of the underlying objectstatic Class<T> TgetTypedObject(Class<T> type) booleangreaterThan(Var var) Check to see if this var is greater than a given var.booleangreaterThanOrEqual(Var var) Check to see if this var is greater than or equal to a given varinthashCode()voidbooleanisEmpty()booleanisNative()isNull()booleanisNumber()booleanisString()iterator()keySet()intlength()booleanCheck to see if this Var is less than some other var.booleanlessThanOrEqual(Var var) Check to see if this var is less than or equal to some other varstatic voidvoidnegate()static VarnewList()static VarnewMap()voidserialize(com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers) voidserializeWithType(com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) voidSet the value of of a list at the index specified.voidvoidvoidSet the value of the underlying object.intsize()If this object is a linked list, then calling this method will return the size of the linked list.toString()Convert this Var to a string format.voidtrim()voidupdateWith(Object obj) static VarStatic constructor to make a var from some value.static Var
-
Field Details
-
EXP_NULL
- See Also:
-
factory
-
engine
-
ISO_PATTERN
-
EMPTY_OBJ_ARRAY
-
VAR_NULL
-
VAR_TRUE
-
VAR_FALSE
-
VAR_ZERO
-
VAR_ONE
-
VAR_NEGATIVE_ONE
-
VAR_EMPTY
-
VAR_DATE_ZERO
-
ALLOWED_TYPES
-
MAPPED_TYPES
-
-
Constructor Details
-
Var
public Var()Construct a Var with an NULL type -
Var
Construct a Var and assign its contained object to that specified.- Parameters:
id- Idobject- The value to set this object to
-
Var
Construct a Var and assign its contained object to that specified.- Parameters:
object- The value to set this object to
-
Var
-
Var
Construct a Var from a given Var- Parameters:
var- var to construct this one from
-
-
Method Details
-
serializeAsJson
- Specified by:
serializeAsJsonin interfaceorg.apache.olingo.odata2.core.ep.producer.OlingoJsonSerializer
-
get
- Specified by:
getin interfaceVirtualClassInterface
-
containsKey
- Specified by:
containsKeyin interfaceVirtualClassInterface
-
set
- Specified by:
setin interfaceVirtualClassInterface
-
isString
public boolean isString() -
isNumber
public boolean isNumber() -
isBoolean
public boolean isBoolean() -
main
-
eval
-
valueOf
Static constructor to make a var from some value.- Parameters:
val- some value to construct a var around- Returns:
- the Var object
-
valueOf
-
deserializeType
-
getType
-
deserialize
-
newMap
-
put
-
newList
-
asObjectArray
-
getType
Get the type of the underlying object- Returns:
- Will return the object's type as defined by Type
-
getId
-
setId
-
getObjectAsDataSource
Get the contained datasource- Returns:
- the object
-
getObject
- Specified by:
getObjectin interfaceVirtualClassInterface
-
setObject
Set the value of the underlying object. Note that the type of Var will be determined when setObject is called.- Parameters:
val- the value to set this Var to
-
getTypedObject
- Specified by:
getTypedObjectin interfaceVariable
-
getObject
-
cloneObject
Clone Object- Returns:
- a new object equal to this one
-
getObjectAsInt
Get object as an int. Does not make sense for a "LIST" type object- Specified by:
getObjectAsIntin interfaceVariable- Returns:
- an integer whose value equals this object
-
getObjectAsLong
Get object as an int. Does not make sense for a "LIST" type object- Returns:
- an integer whose value equals this object
-
getObjectAsShort
-
getObjectAsFile
-
getObjectAsJsonElement
public com.google.gson.JsonElement getObjectAsJsonElement() -
getObjectAsJson
public com.google.gson.JsonElement getObjectAsJson() -
getObjectAsDateTime
Get object as an boolean.- Returns:
- an bool whose value equals this object
-
getObjectAsBoolean
Get object as an boolean.- Returns:
- an bool whose value equals this object
-
getMD5
-
getObjectAsDouble
Get object as a double. Does not make sense for a "LIST" type object.- Specified by:
getObjectAsDoublein interfaceVariable- Returns:
- a double whose value equals this object
-
getObjectAsByteArray
public byte[] getObjectAsByteArray()Get object as a byte array. Does not make sense for a "LIST" type object.- Returns:
- a byte array whose value equals this object
-
getObjectAsString
Get object as a string.- Specified by:
getObjectAsStringin interfaceVariable- Returns:
- The string value of the object. Note that for lists, this is a comma separated list of the form {x,y,z,...}
-
getObjectAsOdata
-
getObjectAsRawList
-
getObjectAsVarList
-
getObjectAsList
Get the object as a list.- Specified by:
getObjectAsListin interfaceVariable- Returns:
- a LinkedList whose elements are of type Var
-
getObjectAsMap
- Specified by:
getObjectAsMapin interfaceVariable
-
getObjectAsPOJOList
-
isNative
public boolean isNative() -
getPOJO
-
iterator
-
get
If this object is a linked list, then calling this method will return the Var at the index indicated- Parameters:
index- the index of the Var to read (0 based)- Returns:
- the Var at that index
-
size
public int size()If this object is a linked list, then calling this method will return the size of the linked list.- Returns:
- size of list
-
length
public int length() -
trim
public void trim() -
set
Set the value of of a list at the index specified. Note that this is only value if this object is a list and also note that index must be in bounds.- Parameters:
index- the index into which the Var will be insertedvar- the var to insert
-
addAll
Add all values from one List to another. Both lists are Var objects that contain linked lists.- Parameters:
var- The list to add
-
hashCode
public int hashCode() -
equals
Test to see if this object equals another one. This is done by converting both objects to strings and then doing a string compare. -
inc
-
multiply
-
append
-
lessThan
Check to see if this Var is less than some other var.- Parameters:
var- the var to compare to- Returns:
- true if it is less than
-
lessThanOrEqual
Check to see if this var is less than or equal to some other var- Parameters:
var- the var to compare to- Returns:
- true if this is less than or equal to var
-
greaterThan
Check to see if this var is greater than a given var.- Parameters:
var- the var to compare to.- Returns:
- true if this object is grater than the given var
-
greaterThanOrEqual
Check to see if this var is greater than or equal to a given var- Parameters:
var- the var to compare to- Returns:
- true if this var is greater than or equal to the given var
-
compareTo
Compare this object's value to another- Specified by:
compareToin interfaceComparable<Var>- Parameters:
var- the object to compare to- Returns:
- the value 0 if this is equal to the argument; a value less than 0 if this is numerically less than the argument; and a value greater than 0 if this is numerically greater than the argument (signed comparison).
-
toString
Convert this Var to a string format. -
negate
-
serialize
public void serialize(com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers) throws IOException - Specified by:
serializein interfacecom.fasterxml.jackson.databind.JsonSerializable- Throws:
IOException
-
serializeWithType
public void serializeWithType(com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) throws IOException - Specified by:
serializeWithTypein interfacecom.fasterxml.jackson.databind.JsonSerializable- Throws:
IOException
-
keySet
-
getField
-
getStringField
-
setField
-
updateWith
-
isNull
-
isEmpty
-
isEmptyOrNull
-