Record Class JxValue
java.lang.Object
java.lang.Record
com.inductiveautomation.perspective.designer.model.JxValue
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasDouble()asInt()Optional<com.teamdev.jxbrowser.js.JsObject>asLong()asString()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanbooleanisNumber()booleanisString()com.inductiveautomation.ignition.common.gson.JsonElementtoJson()final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
JxValue
Creates an instance of aJxValuerecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
asJsObject
- Returns:
- an optional containing the raw
JsObjectheld by this value, if and only if the original value was a JsObject, otherwise returnsOptional.empty()
-
asInt
-
asDouble
-
asLong
-
asString
- Returns:
- Optional containing
Stringif the javascript source value was a string literal or String.
-
isString
public boolean isString()- Returns:
- true if the held value is an instance of
String
-
isNumber
public boolean isNumber()- Returns:
- true if the value is an instance of
Number. Will not coerce or parse.
-
isJsObject
public boolean isJsObject()- Returns:
- true if the value held is a
JsObject. If true, the originating value may be a javascript object literal, an instance of a javascript Object, or an array.
-
toJson
public com.inductiveautomation.ignition.common.gson.JsonElement toJson() -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-