Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@PreferenceEntity(name = "UserProfile")
public class Profile {
protected final boolean login = false;
@KeyName(name = "nickname") protected final String userNickName = null;
@KeyName(name = "visits") protected final int visitCount = 1;
@KeyName(name = "userPet")
@TypeConverter(converter = PetConverter.class)
protected Pet userPetInfo;
@PreferenceFunction(keyname = "nickname")
public String putUserNickFunction(String nickname) {
return "Hello, " + nickname;
}
@PreferenceFunction(keyname = "nickname")
public String getUserNickFunction(String nickname) {
return nickname + "!!!";
}
@PreferenceFunction(keyname = "visits")
public int putVisitCountFunction(int count) {
return ++count;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment