Class StringValue


  • public class StringValue
    extends Value
    Implements an SGr value containing a string value.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void absValue()
      Sets the instance's value to its absolute value, if possible.
      StringValue[] asArray()
      Gets the value as array.
      boolean equals​(java.lang.Object o)  
      java.util.Map<java.lang.String,​java.lang.Boolean> getBitmap()
      Gets the value as SGr bitmap.
      boolean getBoolean()
      Gets the value as boolean.
      java.time.Instant getDateTime()
      Gets the value as time stamp.
      EnumRecord getEnum()
      Gets the value as SGr enumeration record.
      float getFloat32()
      Gets the value as 32-bit floating-point.
      double getFloat64()
      Gets the value as 64-bit floating-point.
      short getInt16()
      Gets the value as 16-bit integer.
      int getInt16U()
      Gets the value as unsigned 16-bit integer.
      int getInt32()
      Gets the value as 32-bit integer.
      long getInt32U()
      Gets the value as unsigned 32-bit integer.
      long getInt64()
      Gets the value as 64-bit integer.
      java.math.BigInteger getInt64U()
      Gets the value as unsigned 64-bit integer.
      byte getInt8()
      Gets the value as 8-bit integer.
      short getInt8U()
      Gets the value as unsigned 8-bit integer.
      com.fasterxml.jackson.databind.JsonNode getJson()
      Gets the value as JSON.
      <T> T getJson​(java.lang.Class<T> aClass)
      Gets the value as JSON and converts to an instance of a given class.
      java.lang.String getString()
      Gets the value as string.
      int hashCode()  
      static StringValue of​(java.lang.String value)
      Creates a new instance.
      void roundToInt()
      Rounds the instance's value to the nearest integer, if possible.
      void scaleDown​(int mul, int powOf10)
      Scales down by powers of 10.
      void scaleUp​(int mul, int powOf10)
      Scales up by powers of 10.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getInt8

        public byte getInt8()
        Description copied from class: Value
        Gets the value as 8-bit integer.
        Specified by:
        getInt8 in class Value
        Returns:
        a byte
      • getInt8U

        public short getInt8U()
        Description copied from class: Value
        Gets the value as unsigned 8-bit integer.
        Specified by:
        getInt8U in class Value
        Returns:
        a short
      • getInt16

        public short getInt16()
        Description copied from class: Value
        Gets the value as 16-bit integer.
        Specified by:
        getInt16 in class Value
        Returns:
        a short
      • getInt16U

        public int getInt16U()
        Description copied from class: Value
        Gets the value as unsigned 16-bit integer.
        Specified by:
        getInt16U in class Value
        Returns:
        an int
      • getInt32

        public int getInt32()
        Description copied from class: Value
        Gets the value as 32-bit integer.
        Specified by:
        getInt32 in class Value
        Returns:
        an int
      • getInt32U

        public long getInt32U()
        Description copied from class: Value
        Gets the value as unsigned 32-bit integer.
        Specified by:
        getInt32U in class Value
        Returns:
        a long
      • getInt64

        public long getInt64()
        Description copied from class: Value
        Gets the value as 64-bit integer.
        Specified by:
        getInt64 in class Value
        Returns:
        a long
      • getInt64U

        public java.math.BigInteger getInt64U()
        Description copied from class: Value
        Gets the value as unsigned 64-bit integer.
        Specified by:
        getInt64U in class Value
        Returns:
        a BigInteger
      • getFloat32

        public float getFloat32()
        Description copied from class: Value
        Gets the value as 32-bit floating-point.
        Specified by:
        getFloat32 in class Value
        Returns:
        a float
      • getFloat64

        public double getFloat64()
        Description copied from class: Value
        Gets the value as 64-bit floating-point.
        Specified by:
        getFloat64 in class Value
        Returns:
        a double
      • getString

        public java.lang.String getString()
        Description copied from class: Value
        Gets the value as string.
        Specified by:
        getString in class Value
        Returns:
        a string
      • getBoolean

        public boolean getBoolean()
        Description copied from class: Value
        Gets the value as boolean.
        Specified by:
        getBoolean in class Value
        Returns:
        a boolean
      • getEnum

        public EnumRecord getEnum()
        Description copied from class: Value
        Gets the value as SGr enumeration record.
        Specified by:
        getEnum in class Value
        Returns:
        an EnumRecord
      • getBitmap

        public java.util.Map<java.lang.String,​java.lang.Boolean> getBitmap()
        Description copied from class: Value
        Gets the value as SGr bitmap.
        Specified by:
        getBitmap in class Value
        Returns:
        a map of strings to boolean values
      • getDateTime

        public java.time.Instant getDateTime()
        Description copied from class: Value
        Gets the value as time stamp.
        Specified by:
        getDateTime in class Value
        Returns:
        an Instant
      • getJson

        public com.fasterxml.jackson.databind.JsonNode getJson()
        Description copied from class: Value
        Gets the value as JSON.
        Specified by:
        getJson in class Value
        Returns:
        a JsonNode
      • getJson

        public <T> T getJson​(java.lang.Class<T> aClass)
        Description copied from class: Value
        Gets the value as JSON and converts to an instance of a given class.
        Overrides:
        getJson in class Value
        Type Parameters:
        T - the generic type
        Parameters:
        aClass - the class to convert to
        Returns:
        an instance of the given class
      • scaleDown

        public void scaleDown​(int mul,
                              int powOf10)
        Scales down by powers of 10.
        Parameters:
        mul - the multiplicator
        powOf10 - the exponent of the power of 10
      • scaleUp

        public void scaleUp​(int mul,
                            int powOf10)
        Scales up by powers of 10.
        Parameters:
        mul - the multiplicator
        powOf10 - the exponent of the power of 10
      • asArray

        public StringValue[] asArray()
        Description copied from class: Value
        Gets the value as array.
        Specified by:
        asArray in class Value
        Returns:
        an array of Value
      • absValue

        public void absValue()
        Description copied from class: Value
        Sets the instance's value to its absolute value, if possible.
        Specified by:
        absValue in class Value
      • roundToInt

        public void roundToInt()
        Description copied from class: Value
        Rounds the instance's value to the nearest integer, if possible.
        Specified by:
        roundToInt in class Value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • of

        public static StringValue of​(java.lang.String value)
        Creates a new instance.
        Parameters:
        value - the string value
        Returns:
        an instance of StringValue
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object