Guest User

Untitled

a guest
Jul 16th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1. public abstract class AWUserType<T extends UserType> extends AWType<T> {
  2.     public AWUserType(T o) {
  3.         super(o);
  4.     }
  5.  
  6.     public List<UserPermissions> getStandardPermissions() {
  7.         return o.standardPermissions;
  8.     }
  9.  
  10.     public boolean isNeededForTreatment() {
  11.         return o.neededForTreatment;
  12.     }
  13.  
  14.     public void setNeededForTreatment(boolean neededForTreatment) {
  15.         o.neededForTreatment = neededForTreatment;
  16.     }
  17. }
  18.  
  19. public class WUserType extends AWUserType<UserType> {
  20.     public WUserType(UserType o) {
  21.         super(o);
  22.     }
  23.  
  24.     /*
  25.      * Static methods needed in order to be able to put this object in a
  26.      * WrapperList
  27.      */
  28.     private static WrapperFactory<UserType, WUserType> factory = null;
  29.  
  30.     public static WrapperFactory<UserType, WUserType> getFactory() {
  31.         if (factory == null) {
  32.             factory = new WrapperFactory<UserType, WUserType>() {
  33.                 @Override
  34.                 public WUserType wrap(UserType u) {
  35.                     return new WUserType(u);
  36.                 }
  37.             };
  38.         }
  39.         return factory;
  40.     }
  41. }
Add Comment
Please, Sign In to add comment