-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Kotlin properties (#776)
* Initial support for Kotlin properties in sqlite variant * Finish tests for Kotlin properties support in sqlite variant * Add Kotlin properties support to content resolver variant
- Loading branch information
1 parent
da7a1f5
commit 6d92d70
Showing
59 changed files
with
1,834 additions
and
72 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...essor/src/main/kotlin/com/pushtorefresh/storio/common/annotations/processor/Extensions.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,4 @@ | ||
package com.pushtorefresh.storio.common.annotations.processor | ||
|
||
fun String.startsWithIs(): Boolean = this.startsWith("is") && this.length > 2 | ||
&& Character.isUpperCase(this[2]) |
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
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
71 changes: 71 additions & 0 deletions
71
...ntent-resolver-annotations-processor-test/src/test/resources/BoxedTypesPrivateFields.java
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,71 @@ | ||
package com.pushtorefresh.storio.contentresolver.annotations; | ||
|
||
@StorIOContentResolverType(uri = "content://uri") | ||
public class BoxedTypesPrivateFields { | ||
|
||
@StorIOContentResolverColumn(name = "field1") | ||
private Boolean field1; | ||
|
||
@StorIOContentResolverColumn(name = "field2") | ||
private Short field2; | ||
|
||
@StorIOContentResolverColumn(name = "field3") | ||
private Integer field3; | ||
|
||
@StorIOContentResolverColumn(name = "field4", key = true) | ||
private Long field4; | ||
|
||
@StorIOContentResolverColumn(name = "field5") | ||
private Float field5; | ||
|
||
@StorIOContentResolverColumn(name = "field6") | ||
private Double field6; | ||
|
||
public Boolean getField1() { | ||
return field1; | ||
} | ||
|
||
public void setField1(Boolean field1) { | ||
this.field1 = field1; | ||
} | ||
|
||
public Short getField2() { | ||
return field2; | ||
} | ||
|
||
public void setField2(Short field2) { | ||
this.field2 = field2; | ||
} | ||
|
||
public Integer getField3() { | ||
return field3; | ||
} | ||
|
||
public void setField3(Integer field3) { | ||
this.field3 = field3; | ||
} | ||
|
||
public Long getField4() { | ||
return field4; | ||
} | ||
|
||
public void setField4(Long field4) { | ||
this.field4 = field4; | ||
} | ||
|
||
public Float getField5() { | ||
return field5; | ||
} | ||
|
||
public void setField5(Float field5) { | ||
this.field5 = field5; | ||
} | ||
|
||
public Double getField6() { | ||
return field6; | ||
} | ||
|
||
public void setField6(Double field6) { | ||
this.field6 = field6; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...-processor-test/src/test/resources/BoxedTypesPrivateFieldsContentResolverTypeMapping.java
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,14 @@ | ||
package com.pushtorefresh.storio.contentresolver.annotations; | ||
|
||
import com.pushtorefresh.storio.contentresolver.ContentResolverTypeMapping; | ||
|
||
/** | ||
* Generated mapping with collection of resolvers | ||
*/ | ||
public class BoxedTypesPrivateFieldsContentResolverTypeMapping extends ContentResolverTypeMapping<BoxedTypesPrivateFields> { | ||
public BoxedTypesPrivateFieldsContentResolverTypeMapping() { | ||
super(new BoxedTypesPrivateFieldsStorIOContentResolverPutResolver(), | ||
new BoxedTypesPrivateFieldsStorIOContentResolverGetResolver(), | ||
new BoxedTypesPrivateFieldsStorIOContentResolverDeleteResolver()); | ||
} | ||
} |
Oops, something went wrong.