Advertisement
Zoilorys

User Class

Mar 30th, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. import java.io.Serializable;
  2.  
  3. public class User implements Serializable {
  4.  
  5.     private String userName;
  6.     private boolean isOnline = false;
  7.    
  8.     public User(){
  9.        
  10.         isOnline = true;
  11.        
  12.     }
  13.    
  14.     public User(boolean status){
  15.        
  16.         isOnline = status;
  17.        
  18.     }
  19.    
  20.     public boolean isOnline(){
  21.        
  22.         if(isOnline){
  23.            
  24.             return true;
  25.            
  26.         }else{
  27.            
  28.             return false;
  29.            
  30.         }
  31.        
  32.     }
  33.    
  34.     public void setOnlineStatus(boolean status){
  35.        
  36.         isOnline = status;
  37.        
  38.     }
  39.    
  40.     public void setName(String name){
  41.        
  42.         userName = name;
  43.        
  44.     }
  45.    
  46.     public String getName(){
  47.        
  48.         return userName;
  49.        
  50.     }
  51.    
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement