Package sk.ipesoft.d2000.d2japi.unival
Class UnivalValueUtils
- java.lang.Object
-
- sk.ipesoft.d2000.d2japi.unival.UnivalValueUtils
-
public class UnivalValueUtils extends java.lang.ObjectUtility class for operations with univals.
-
-
Constructor Summary
Constructors Constructor Description UnivalValueUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static sk.ipesoft.d2000.base.UnivalValue<?>createUnivalValue(java.lang.Object value, sk.ipesoft.d2000.base.UnivalType type)Create new instance of UnivalValue with default unival value type determined bytypeparameterstatic sk.ipesoft.d2000.base.UnivalValue<?>createUnivalValue(java.lang.Object value, sk.ipesoft.d2000.base.UnivalValueType type)Create new instance of UnivalValue with actual unival type determined bytypeparameter.static <T> sk.ipesoft.d2000.base.UnivalValue<T>createUnivalValue(T value)Create appropriateUnivalValueinstance with its value set to thevalueparameter.static sk.ipesoft.d2000.base.UnivalValue<?>createUnivalValueUntyped(java.lang.Object value)Create appropriateUnivalValueinstance fromvalue.static sk.ipesoft.d2000.base.UnivalTyperesolveUnivalType(java.lang.Object value)Determine unival type fromvalueparameter.
-
-
-
Method Detail
-
createUnivalValue
public static <T> sk.ipesoft.d2000.base.UnivalValue<T> createUnivalValue(T value)
Create appropriateUnivalValueinstance with its value set to thevalueparameter. Actual type of the result is derived from the actual type of thevalueparameter according to the following rules:UnivalNanfornull,UnivalIntforInteger,UnivalRealforDouble,UnivalTextforString,UnivalBooleanforBoolean,UnivalTimeforDate,- throws
IllegalArgumentExceptionotherwise.
- Type Parameters:
T- actual type ofvalueparameter- Parameters:
value- value of resulting unival.- Returns:
- Unival object of appropriate type with value of
valueparameter.
-
createUnivalValue
public static sk.ipesoft.d2000.base.UnivalValue<?> createUnivalValue(java.lang.Object value, sk.ipesoft.d2000.base.UnivalValueType type)Create new instance of UnivalValue with actual unival type determined bytypeparameter.- Parameters:
value- valid value ornullfor invalidtype- unival value type- Returns:
- new instance
-
createUnivalValue
public static sk.ipesoft.d2000.base.UnivalValue<?> createUnivalValue(java.lang.Object value, sk.ipesoft.d2000.base.UnivalType type)Create new instance of UnivalValue with default unival value type determined bytypeparameter- Parameters:
value- valid value ornullfor invalidtype- unival type- Returns:
- new instance
-
createUnivalValueUntyped
public static sk.ipesoft.d2000.base.UnivalValue<?> createUnivalValueUntyped(java.lang.Object value)
Create appropriateUnivalValueinstance fromvalue.- Parameters:
value- value to be wrapped in unival- Returns:
- new unival object
-
resolveUnivalType
public static sk.ipesoft.d2000.base.UnivalType resolveUnivalType(java.lang.Object value)
Determine unival type fromvalueparameter.nullUnivalType.nanIntegerUnivalType.integerDoubleUnivalType.realStringUnivalType.textBooleanorVBoolUnivalType.boolLongorDateUnivalType.timeVAlarmUnivalType.alarmVStationUnivalType.stationVProcessUnivalType.processVQvalUnivalType.qval- anything else
- throws IllegalArgumentException
- Parameters:
value- inspected value- Returns:
-
-