Created
January 13, 2018 13:24
-
-
Save skydoves/0b33ab5cabc48a67435b8c6945b30fe3 to your computer and use it in GitHub Desktop.
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
@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