Skip to content

Commit 9790711

Browse files
refactor: change method name mapper
1 parent 2fba752 commit 9790711

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/dev/resms/core/mapper/IMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public interface IMapper {
99
* @param object The object to be converted to JSON.
1010
* @return The JSON representation of the object.
1111
*/
12-
String writeValue(Object object);
12+
String toJson(Object object);
1313

1414
/**
1515
* Converts the provided JSON value into an instance of the specified class.
@@ -19,5 +19,5 @@ public interface IMapper {
1919
* @param <T> The type of the resulting object.
2020
* @return An instance of the specified class with values from the JSON value.
2121
*/
22-
<T> T readValue(String value, Class<T> clazz);
22+
<T> T fromJson(String value, Class<T> clazz);
2323
}

src/main/java/dev/resms/core/mapper/ReSMSMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public ReSMSMapper() {
2222
* @return The JSON representation of the object.
2323
*/
2424
@Override
25-
public String writeValue(Object object) {
25+
public String toJson(Object object) {
2626
return moshi.adapter(Object.class).toJson(object);
2727
}
2828

@@ -35,7 +35,7 @@ public String writeValue(Object object) {
3535
* @return An instance of the specified class with values from the JSON value.
3636
*/
3737
@Override
38-
public <T> T readValue(String value, Class<T> clazz) {
38+
public <T> T fromJson(String value, Class<T> clazz) {
3939
try {
4040
return moshi.adapter(clazz).fromJson(value);
4141
} catch (IOException e) {

0 commit comments

Comments
 (0)