Interface IIxValue

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static IIxValue EMPTY  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      BigDecimal asBigDecimal()
      Returns a big decimal value.
      BigDecimal asBigDecimal​(BigDecimal p_fallbackValue)
      Returns a big decimal value or the fallback value on an empty value.
      boolean asBoolean()
      Returns the a boolean value.
      boolean asBoolean​(boolean p_bFallbackValue)
      Returns the boolean value or the fallback value on an empty value.
      Date asDate()
      Returns the date value.
      Date asDate​(Date p_fallbackValue)
      Returns the date value or the fallback date for an empty value.
      double asDouble()
      Returns a double value.
      double asDouble​(double p_dFallbackValue)
      Returns the value as an double or the fallback value on an empty value.
      int asInt()
      Returns a integer value.
      int asInt​(int p_iFallbackValue)
      Returns a integer value or the fallback value on an empty value.
      long asLong()
      Returns a long value.
      long asLong​(long p_lFallbackValue)
      Returns a long value or the fallback value on an empty value.
      String asString()
      Returns the value as an string
      String asString​(String p_strFallbackValue)
      Returns the value as an string
      Date asTime()
      Returns the time value.
      Date asTime​(Date p_fallback)
      Returns the time value or the fallback value on an empty value.
      Timestamp asTimestamp()
      Returns a timestamp value.
      Timestamp asTimestamp​(Timestamp p_fallbackValue)
      Returns the timestamp value or the given fallback value for an empty value.
      IValueHolder<?> asValueHolder()
      Returns the value as an value holder.
      de.uplanet.lucy.types.UP_TYPE getType()
      Returns the type.
      Object getValue()
      Returns the physical value.
      boolean hasValue()
      Returns true if the value is not empty or exits.
      boolean isPrimitive()
      Returns true on a primitive value type like integer or boolean.
    • Method Detail

      • getType

        de.uplanet.lucy.types.UP_TYPE getType()
        Returns the type. For internal use only.
        Returns:
        Returns the value type (not null).
      • asValueHolder

        IValueHolder<?> asValueHolder()
        Returns the value as an value holder.
        Returns:
        Converts a IIxValue to an value holder.
      • asBoolean

        boolean asBoolean()
        Returns the a boolean value.
         Cast Rules:
                String
                        "0" = false
                        "1" = true
                        "true" = true
                        "false" = false
                                all other values false
        
                Numeric (int, long, double):
                        0 = false
                        1 = true
                        other values true (value != 0)
         
        Returns:
        Returns the value as an boolean.
        Throws:
        IllegalArgumentException - Throws an exception if hasValue() == false or the value type cannot be casted to an boolean.
      • asBoolean

        boolean asBoolean​(boolean p_bFallbackValue)
        Returns the boolean value or the fallback value on an empty value.
         Cast Rules:
                String
                        "0" = false
                        "1" = true
                        "true" = true
                        "false" = false
                                all other values false
                Numeric (int, long, double):
                        0 = false
                        1 = true
                                all other values true (value != 0)
         
        Parameters:
        p_bFallbackValue - The fallback value used if hasValue() == false.
        Returns:
        Returns the value as an boolean or the given fallback value if hasValue() == false.
        Throws:
        IllegalArgumentException - Throws a runtime exception if the value cannot be casted to a boolean.
      • asDouble

        double asDouble()
        Returns a double value.
         Cast Rules:
                String
                        Double.parseDouble(value)
        
                Numeric Types
                        (double)value
         
        Returns:
        Returns the value as an double.
        Throws:
        IllegalArgumentException - Throws an exception if hasValue() == false or the value type cannot be casted to an double.
      • asDouble

        double asDouble​(double p_dFallbackValue)
        Returns the value as an double or the fallback value on an empty value.
         Cast Rules:
                String
                        Double.parseDouble(value)
        
                Numeric:
                        (double)value
         
        Parameters:
        p_dFallbackValue - The fallback value used if hasValue() == false.
        Returns:
        Returns the value as an double or the fallback value if hasValue() == false.
        Throws:
        IllegalArgumentException - Throws a runtime exception if the value cannot be casted to a double.
      • asInt

        int asInt()
        Returns a integer value.
         Cast Rules:
                String
                        Integer.parseInteger(value)
        
                Numeric Types
                        (int)value
         
        Returns:
        Returns the value as an integer.
        Throws:
        IllegalArgumentException - Throws an exception if hasValue() == false or the value type cannot be casted to an integer.
      • asInt

        int asInt​(int p_iFallbackValue)
        Returns a integer value or the fallback value on an empty value.
         Cast Rules:
                String
                        Integer.parseInteger(value)
        
                Numeric Types
                        (int)value
        
          Other types:
                String.valueOf(type) will check.
         
        Parameters:
        p_iFallbackValue - The fallback value used if hasValue() == false.
        Returns:
        Returns the value as an integer or p_iFallbackValue if hasValue() == false
        Throws:
        IllegalArgumentException - Throws a runtime exception if the value cannot be casted to a integer.
      • asLong

        long asLong()
        Returns a long value.
         Cast Rules:
                String
                        Long.parseLong(value)
        
                Numeric Types
                        (long)value
         
        Returns:
        Returns the value as an long. Throws an exception if hasValue() == false or the value type cannot be casted to an long.
      • asLong

        long asLong​(long p_lFallbackValue)
        Returns a long value or the fallback value on an empty value.
         Cast Rules:
                String
                        Long.parseLong(value)
        
                Numeric Types
                        (long)value
        
          Other types:
                String.valueOf(type) will check.
         
        Parameters:
        p_lFallbackValue - The fallback value used if hasValue() == false.
        Returns:
        Returns the value as an long or p_lFallbackValue if hasValue() == false.
        Throws:
        IllegalArgumentException - Throws a runtime exception if the value cannot be casted to a long.
      • asTimestamp

        Timestamp asTimestamp()
        Returns a timestamp value.
                Value must be a date / timestamp type. No cast will be done.
         
        Returns:
        Returns the value as an timestamp.
        Throws:
        IllegalArgumentException - Throws an exception if hasValue() == false or the value type cannot be casted to an timestamp.
      • asTimestamp

        Timestamp asTimestamp​(Timestamp p_fallbackValue)
        Returns the timestamp value or the given fallback value for an empty value.
                Value must be a date / timestamp type. No cast will be done.
         
        Parameters:
        p_fallbackValue - The fallback value used if hasValue() == false.
        Returns:
        Returns the value as an timestamp.
        Throws:
        IllegalArgumentException - Throws a runtime exception if the value is not a date or timestamp value.
      • asDate

        Date asDate()
        Returns the date value.
                Value must be a date / time stamp / string type.
         
        Returns:
        Returns the value as an date.
        Throws:
        IllegalArgumentException - Throws an exception if hasValue() == false or the value type cannot be casted to an date.
      • asDate

        Date asDate​(Date p_fallbackValue)
        Returns the date value or the fallback date for an empty value.
                Value must be a date / time stamp / string type.
         
        Parameters:
        p_fallbackValue - The fallback value used if hasValue() == false.
        Returns:
        Returns the value as an date.
        Throws:
        IllegalArgumentException - Throws a runtime exception if the value is not a date or timestamp value.
      • asTime

        Date asTime()
        Returns the time value.
                Value must be a time / time stamp / string type.
         
        Returns:
        Returns the value as an time.
        Throws:
        IllegalArgumentException - Throws an exception if hasValue() == false or the value type cannot be casted to an time.
      • asTime

        Date asTime​(Date p_fallback)
        Returns the time value or the fallback value on an empty value.
                Value must be a time / time stamp / string type.
         
        Returns:
        Returns the value as an time or the fallback value on an empty value.
        Throws:
        IllegalArgumentException - Throws an exception if hasValue() != false and the value type cannot be casted to an time.
      • asBigDecimal

        BigDecimal asBigDecimal()
        Returns a big decimal value.
         Cast Rules:
                String
                        new BigDecimal(value)
                Numeric Types
                        new BigDecimalvalue)
                
        Returns:
        Returns the value as an big decimal or null if hasValue() == false.
        Throws:
        IllegalArgumentException - Throws an exception if hasValue() == false or the value type cannot be casted to an big decimal.
      • asBigDecimal

        BigDecimal asBigDecimal​(BigDecimal p_fallbackValue)
        Returns a big decimal value or the fallback value on an empty value.
         Cast Rules:
                String
                        new BigDecimal(value)
                Numeric Types
                        new BigDecimalvalue)
                
        Parameters:
        p_fallbackValue - The fallback value used if hasValue() == false.
        Returns:
        Returns the value as an string or p_fallbackValue if hasValue() == false.
        Throws:
        IllegalArgumentException - Throws a runtime exception if the value cannot be casted to a big decimal.
      • asString

        String asString()
        Returns the value as an string
         Cast Rules:
            Date values: A string representation of the date in the yyyy-MM-dd HH:mm:ss format,
            calculated for the TimeZone UTC.
        
            Other Types: String.valueOf(type) will returned.
         
        Returns:
        Returns the value as an string.
        Throws:
        IllegalArgumentException - Throws an exception if hasValue() == false.
      • asString

        String asString​(String p_strFallbackValue)
        Returns the value as an string
         Cast Rules:
            Date values: A string representation of the date in the yyyy-MM-dd HH:mm:ss format,
            calculated for the TimeZone UTC.
        
            Other Types: String.valueOf(type) will returned.
         
        Parameters:
        p_strFallbackValue - The fallback value used if hasValue() == false.
        Returns:
        Returns the value as an string or p_strFallbackValue if hasValue() == false.
      • hasValue

        boolean hasValue()
        Returns true if the value is not empty or exits.
        Returns:
        Returns true if getValue() != null otherwise false will returned.
      • isPrimitive

        boolean isPrimitive()
        Returns true on a primitive value type like integer or boolean.
        Returns:
        Returns true if the value represent an primitive type like a boolean, integer...