Skip to content

Commit

Permalink
#177 Transient Annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
furkanaskin committed May 27, 2020
1 parent 7aec6b1 commit e08edcc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
[![alt text][InstagramIcon]][Instagram]
[![alt text][TelegramIcon]][Telegram]

### #177 Transient Annotation
![alt text](/screenshots/Transient.png)

### #176 ConstraintLayout Aspect Ratio
![alt text](/screenshots/ConstraintLayoutAspectRatio.png)

Expand Down
25 changes: 25 additions & 0 deletions codes/Transient.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Marks the JVM backing field of the annotated property as transient,
* meaning that it is not part of the default serialized form of the object.
*
* When to use?
* For example it can be used for request classes.
* Transient values will be ignored on your POST request.
*/

@Parcelize
@JsonClass(generateAdapter = true)
data class FilterRequest(
@Json(name = "color")
var color: String? = null,
@Json(name = "sort")
var sort: String? = null,
@Json(name = "currency")
val currency: String? = null,
@Json(name = "lang")
val lang: String? = null,
@Transient // Ignored when converted to Json value.
var selectedStartDate: LocalDate? = null,
@Transient // Ignored when converted to Json value.
var selectedEndDate: LocalDate? = null
) : Parcelable
Binary file added screenshots/Transient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e08edcc

Please sign in to comment.