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 boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
boolean
isNumber()
boolean
isString()
com.inductiveautomation.ignition.common.gson.JsonElement
toJson()
final String
toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.
-
Constructor Details
-
JxValue
Creates an instance of aJxValue
record class.- Parameters:
value
- the value for thevalue
record component
-
-
Method Details
-
asJsObject
- Returns:
- an optional containing the raw
JsObject
held by this value, if and only if the original value was a JsObject, otherwise returnsOptional.empty()
-
asInt
-
asDouble
-
asLong
-
asString
- Returns:
- Optional containing
String
if 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 thevalue
record component.- Returns:
- the value of the
value
record component
-