java.lang.Object
com.inductiveautomation.perspective.designer.model.JxValue

public class JxValue extends Object
  • Constructor Details

    • JxValue

      public JxValue(Object value)
  • Method Details

    • asJsObject

      public Optional<com.teamdev.jxbrowser.js.JsObject> asJsObject()
      Returns:
      an optional containing the raw JsObject held by this value, if and only if the original value was a JsObject, otherwise returns Optional.empty()
    • asInt

      public Optional<Integer> asInt()
      If the value is a Number, or is a String value parsable as a number, will return an optional containing an Integer representation of the value. Otherwise will return an empty optional.
    • asDouble

      public Optional<Double> asDouble()
      If the value is a Number, or is a String value parsable as a number, will return an optional containing a Double representation of the value. Otherwise will return an empty optional.
    • asLong

      public Optional<Long> asLong()
      Get an Optional containing a Long if the value held is a Long, a Number, or a String that is parseable to a Number. Otherwise returns an empty Optional.
    • asString

      public Optional<String> 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()
    • getRawValue

      @Nullable public Object getRawValue()
      Returns:
      the raw value contained. May be null if originating JxBrowser value was null or undefined.
    • toString

      public String toString()
      Overrides:
      toString in class Object