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 BigDecimalasBigDecimal(String value) Convert to BigDecimal (not nullable).static BigIntegerasBigInteger(String value) Convert to BigInteger (not nullable).static booleanConvert to boolean.static booleanConvert to boolean.static doubleConvert to double.static <T> EnumConvert to enum.static floatConvert to float.static InstantConvert to Instant (not nullable).static intConvert to int.static IntegerConvert to Integer (not nullable).static LocalDateasLocalDate(String value) Convert to LocalDate (not nullable).static LocalDateTimeasLocalDateTime(String value) Convert to LocalDateTime (not nullable).static LocalTimeasLocalTime(String value) Convert to LocalTime (not nullable).static longConvert to long.static OffsetDateTimeasOffsetDateTime(String value) Convert to OffsetDateTime (not nullable).static UUIDConvert to UUID (not nullable).static StringCheck for null for a required property throwing RequiredArgumentException if the value is null.static <T> List<T> static <T> Set<T> static BigDecimaltoBigDecimal(String value) Convert to BigDecimal (allowing nulls).static BigIntegertoBigInteger(String value) Convert to BigInteger (allowing nulls).static BooleanConvert to Boolean (allowing nulls).static DoubleConvert to Double (allowing nulls).static FloatConvert to Float (allowing nulls).static InstantConvert to Instant (allowing nulls).static IntegerConvert to Integer (allowing nulls).static LocalDatetoLocalDate(String value) Convert to LocalDate (allowing nulls).static LocalDateTimetoLocalDateTime(String value) Convert to LocalDateTime (allowing nulls).static LocalTimetoLocalTime(String value) Convert to LocalTime (allowing nulls).static LongConvert to Long (allowing nulls).static OffsetDateTimetoOffsetDateTime(String value) Convert to OffsetDateTime (allowing nulls).static UUIDConvert to UUID (allowing nulls).static StringwithDefault(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).
-