Skip to content

Instantly share code, notes, and snippets.

@fcamblor
Last active February 21, 2018 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcamblor/f91fb5d8640a8ca53f7feaa0a9597a0d to your computer and use it in GitHub Desktop.
Save fcamblor/f91fb5d8640a8ca53f7feaa0a9597a0d to your computer and use it in GitHub Desktop.
RestX "raw" types list
For an upcoming RestX feature (see https://github.com/restx/restx/issues/146)), we need to identify what are the common "raw types" you are using on your projects.
A "raw type" has generally following properties :
- it allows to represent a "single" value
- it should be deserializable from a single string value
- it should be serializable to a single string value
- instance is generally immutable
Here are the current listing of identified types :
[Primitive type & their wrapper]
- byte & java.lang.Byte
- short & java.lang.Short
- int & java.lang.Integer
- long & java.lang.Long
- float & java.lang.Float
- double & java.lang.Double
- boolean & java.lang.Boolean
- char & java.lang.Character
[Common JDK value classes]
- java.lang.String
- java.lang.Class
- java.lang.Enum subtypes
- java.io.File
- java.math.BigDecimal
- java.math.BigInteger
- java.util.Currency
- java.util.Date
- java.util.Locale
- java.util.TimeZone
- java.util.UUID
- java.nio.charset.Charset
- java.nio.file.Path
- java.util.regex.Pattern
- java.net.URI
- java.net.URL
[Java 8 Date API]
- java.time.Instant
- java.time.DayOfWeek
- java.time.LocalDate
- java.time.LocalDateTime
- java.time.LocalTime
- java.time.Month
- java.time.Year
- java.time.ZoneId
[Joda date time API]
- org.joda.time.DateTime
- org.joda.time.Instant
- org.joda.time.LocalDate
- org.joda.time.LocalDateTime
- org.joda.time.LocalTime
- org.joda.time.DateTimeZone
[Mongo/Jongo API]
- org.bson.types.ObjectId
Some more classes I'm wondering to add :
- java.util.concurrent.atomic.Atomic* classes
- java.sql.* types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment