java.lang.Object
io.avaje.http.api.PathTypeConversion
Helper type conversion methods.
These methods are intended to be used by APT source generators.
-
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimal
asBigDecimal
(String value) Convert to BigDecimal (not nullable).static BigInteger
asBigInteger
(String value) Convert to BigInteger (not nullable).static boolean
Convert to boolean.static boolean
Convert to boolean.static double
Convert to double.static <T> Enum
Convert to enum.static float
Convert to float.static Instant
Convert to Instant (not nullable).static int
Convert to int.static Integer
Convert to Integer (not nullable).static LocalDate
asLocalDate
(String value) Convert to LocalDate (not nullable).static LocalDateTime
asLocalDateTime
(String value) Convert to LocalDateTime (not nullable).static LocalTime
asLocalTime
(String value) Convert to LocalTime (not nullable).static long
Convert to long.static OffsetDateTime
asOffsetDateTime
(String value) Convert to OffsetDateTime (not nullable).static UUID
Convert to UUID (not nullable).static String
Check for null for a required property throwing RequiredArgumentException if the value is null.static <T> List
<T> static <T> Set
<T> static BigDecimal
toBigDecimal
(String value) Convert to BigDecimal (allowing nulls).static BigInteger
toBigInteger
(String value) Convert to BigInteger (allowing nulls).static Boolean
Convert to Boolean (allowing nulls).static Double
Convert to Double (allowing nulls).static Float
Convert to Float (allowing nulls).static Instant
Convert to Instant (allowing nulls).static Integer
Convert to Integer (allowing nulls).static LocalDate
toLocalDate
(String value) Convert to LocalDate (allowing nulls).static LocalDateTime
toLocalDateTime
(String value) Convert to LocalDateTime (allowing nulls).static LocalTime
toLocalTime
(String value) Convert to LocalTime (allowing nulls).static Long
Convert to Long (allowing nulls).static OffsetDateTime
toOffsetDateTime
(String value) Convert to OffsetDateTime (allowing nulls).static UUID
Convert to UUID (allowing nulls).static String
withDefault
(String value, String defaultValue) Return the value if non-null and otherwise the default value.withDefault
(List<String> value, List<String> defaultValue)
-
Method Details
-
withDefault
Return the value if non-null and otherwise the default value.- Parameters:
value
- The value to return if non-nulldefaultValue
- The default value to return- Returns:
- The value if non-null and otherwise the default value.
-
withDefault
-
checkNull
Check for null for a required property throwing RequiredArgumentException if the value is null.- Returns:
- The value being checked
-
list
-
set
-
asInt
Convert to int. -
asEnum
Convert to enum. -
asLong
Convert to long. -
asDouble
Convert to double. -
asFloat
Convert to float. -
asBoolean
Convert to boolean. -
asBool
Convert to boolean. -
asBigInteger
Convert to BigInteger (not nullable). -
asBigDecimal
Convert to BigDecimal (not nullable). -
asLocalDate
Convert to LocalDate (not nullable). -
asLocalTime
Convert to LocalTime (not nullable). -
asInstant
Convert to Instant (not nullable). -
asOffsetDateTime
Convert to OffsetDateTime (not nullable). -
asLocalDateTime
Convert to LocalDateTime (not nullable). -
asUUID
Convert to UUID (not nullable). -
asInteger
Convert to Integer (not nullable). -
toInteger
Convert to Integer (allowing nulls). -
toLong
Convert to Long (allowing nulls). -
toDouble
Convert to Double (allowing nulls). -
toFloat
Convert to Float (allowing nulls). -
toBigDecimal
Convert to BigDecimal (allowing nulls). -
toBigInteger
Convert to BigInteger (allowing nulls). -
toBoolean
Convert to Boolean (allowing nulls). -
toUUID
Convert to UUID (allowing nulls). -
toLocalDate
Convert to LocalDate (allowing nulls). -
toLocalTime
Convert to LocalTime (allowing nulls). -
toInstant
Convert to Instant (allowing nulls). -
toOffsetDateTime
Convert to OffsetDateTime (allowing nulls). -
toLocalDateTime
Convert to LocalDateTime (allowing nulls).
-