Skip to content

Instantly share code, notes, and snippets.

@lucassales2
Last active August 14, 2019 08:09
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 lucassales2/abd86dc4bdaffc0bfa144237b156dd22 to your computer and use it in GitHub Desktop.
Save lucassales2/abd86dc4bdaffc0bfa144237b156dd22 to your computer and use it in GitHub Desktop.
data class Language(
val id: Int,
val name: String,
val locale: Locale,
val direction: String,
val isDefault: Boolean,
val isBestFit: Boolean
) {
constructor(jsonObject: JSONObject) : this(
id = jsonObject.getInt("id"),
name = jsonObject.getString("name"),
locale = Locale(jsonObject.getString("locale")),
direction = jsonObject.getString("direction"),
isDefault = jsonObject.getBoolean("is_default"),
isBestFit = jsonObject.getBoolean("is_best_fit")
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment