Skip to content

Commit 8793e1c

Browse files
author
mvgreen
committed
Rename toInheritor() to cast() and remove redundant extension
1 parent 4838675 commit 8793e1c

7 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/main/kotlin/com/ecwid/apiclient/v3/dto/common/FetchedAttributeValue.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ interface FetchedAttributeValue<T : FetchedAttributeValue<T>> {
1010
val value: String?
1111
val show: AttributeValueLocation?
1212

13-
fun toInheritor(): T
13+
fun cast(): T
1414

15-
fun Collection<T>.toInheritorList(): List<T> = this.map { it.toInheritor() }
1615
}

src/main/kotlin/com/ecwid/apiclient/v3/dto/common/UpdatedAttributeValue.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ interface UpdatedAttributeValue<T : UpdatedAttributeValue<T>> {
88
val name: String?
99
val value: String?
1010

11-
fun toInheritor(): T
11+
fun cast(): T
1212

13-
fun Collection<T>.toInheritorList(): List<T> = this.map { it.toInheritor() }
1413
}

src/main/kotlin/com/ecwid/apiclient/v3/dto/custom/CustomAppRequest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ data class CustomAppRequest(
284284
override val show: AttributeValueLocation? = null
285285
) : FetchedAttributeValue<AttributeValue> {
286286

287-
override fun toInheritor() = AttributeValue(
287+
override fun cast() = AttributeValue(
288288
id = id,
289289
name = name,
290290
type = type,

src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/UpdatedProduct.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ data class UpdatedProduct(
279279
override val value: String? = null
280280
) : UpdatedAttributeValue<AttributeValue> {
281281

282-
override fun toInheritor() = AttributeValue(
282+
override fun cast() = AttributeValue(
283283
id = id,
284284
alias = alias,
285285
name = name,

src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ data class FetchedProduct(
242242
override val show: AttributeValueLocation? = null
243243
) : FetchedAttributeValue<AttributeValue> {
244244

245-
override fun toInheritor() = AttributeValue(
245+
override fun cast() = AttributeValue(
246246
id = id,
247247
name = name,
248248
type = type,

src/main/kotlin/com/ecwid/apiclient/v3/dto/variation/request/UpdatedVariation.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ data class UpdatedVariation(
4141
override val value: String? = null
4242
) : UpdatedAttributeValue<AttributeValue> {
4343

44-
override fun toInheritor() = AttributeValue(
44+
override fun cast() = AttributeValue(
4545
id = id,
4646
alias = alias,
4747
name = name,

src/main/kotlin/com/ecwid/apiclient/v3/dto/variation/result/FetchedVariation.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ data class FetchedVariation(
5757
override val show: AttributeValueLocation? = null
5858
) : FetchedAttributeValue<AttributeValue> {
5959

60-
override fun toInheritor() = AttributeValue(
60+
override fun cast() = AttributeValue(
6161
id = id,
6262
name = name,
6363
type = type,

0 commit comments

Comments
 (0)