-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use device as en enum and default to mobile
- Loading branch information
Showing
5 changed files
with
70 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
TopsortAnalytics/src/main/java/com/topsort/analytics/model/auctions/Device.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.topsort.analytics.model.auctions | ||
|
||
enum class Device { | ||
DESKTOP, | ||
MOBILE | ||
} |
18 changes: 18 additions & 0 deletions
18
TopsortAnalytics/src/main/java/com/topsort/analytics/model/auctions/EntityType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.topsort.analytics.model.auctions | ||
|
||
enum class EntityType { | ||
PRODUCT, | ||
VENDOR, | ||
BRAND, | ||
URL; | ||
|
||
companion object { | ||
fun fromValue(value: String): EntityType = when (value) { | ||
"product" -> PRODUCT | ||
"vendor" -> VENDOR | ||
"brand" -> BRAND | ||
"url" -> URL | ||
else -> throw IllegalArgumentException("not valid entity type: $value") | ||
} | ||
} | ||
} |