convert Note model to kotlin

This commit is contained in:
tibbi 2016-11-13 23:46:26 +01:00
parent 8227d5cc56
commit ff8f075e5c
2 changed files with 8 additions and 52 deletions

View File

@ -1,52 +0,0 @@
package com.simplemobiletools.notes.models;
public class Note {
private int mId;
private String mTitle;
private String mValue;
public Note(int id, String title, String value) {
mId = id;
mTitle = title;
mValue = value;
}
public int getId() {
return mId;
}
public String getTitle() {
return mTitle;
}
public String getValue() {
return mValue;
}
public void setId(int id) {
mId = id;
}
public void setValue(String value) {
mValue = value;
}
public void setTitle(String title) {
mTitle = title;
}
@Override
public boolean equals(Object o) {
return o != null && this.toString().equals(o.toString());
}
@Override
public String toString() {
return "Note {" +
"id=" + getId() +
", title=" + getTitle() +
", value=" + getValue() +
"}";
}
}

View File

@ -0,0 +1,8 @@
package com.simplemobiletools.notes.models
class Note(var id: Int, var title: String, var value: String) {
override fun equals(o: Any?) = o != null && this.toString() == o.toString()
override fun toString() = "Note {id=$id, title=$title, value=$value}"
}