Advertisement
Guest User

Untitled

a guest
Apr 9th, 2011
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.62 KB | None | 0 0
  1. package com.vildaberper.Locker;
  2.  
  3. import java.util.List;
  4.  
  5. import javax.persistence.Entity;
  6. import javax.persistence.Id;
  7. import javax.persistence.Table;
  8.  
  9. import org.bukkit.Location;
  10. import org.bukkit.block.Block;
  11.  
  12. import com.avaje.ebean.validation.NotEmpty;
  13. import com.avaje.ebean.validation.NotNull;
  14.  
  15. @Entity()
  16. @Table(name="locker")
  17. public class Lock{
  18.     @Id
  19.     private int id;
  20.  
  21.     @NotEmpty
  22.     private String owner;
  23.  
  24.     @NotEmpty
  25.     private String world;
  26.  
  27.     @NotEmpty
  28.     private String password;
  29.  
  30.     @NotNull
  31.     private List<String> allowed;
  32.  
  33.     @NotNull
  34.     private int x;
  35.  
  36.     @NotNull
  37.     private int y;
  38.  
  39.     @NotNull
  40.     private int z;
  41.  
  42.     public Lock(String owner, List<String> allowed, String password, String world, int x, int y, int z){
  43.         this.owner = owner;
  44.         this.allowed = allowed;
  45.         this.password = password;
  46.         this.world = world;
  47.         this.x = x;
  48.         this.y = y;
  49.         this.z = z;
  50.     }
  51.  
  52.     public Lock(String owner, List<String> allowed, String password, Block block){
  53.         this.owner = owner;
  54.         this.allowed = allowed;
  55.         this.password = password;
  56.         this.world = block.getWorld().getName();
  57.         this.x = block.getX();
  58.         this.y = block.getY();
  59.         this.z = block.getZ();
  60.     }
  61.  
  62.     public Lock(String owner, List<String> allowed, String password, Location location){
  63.         this.owner = owner;
  64.         this.allowed = allowed;
  65.         this.password = password;
  66.         this.world = location.getWorld().getName();
  67.         this.x = location.getBlockX();
  68.         this.y = location.getBlockY();
  69.         this.z = location.getBlockZ();
  70.     }
  71.  
  72.     public void setId(int id){
  73.         this.id = id;
  74.     }
  75.  
  76.     public int getId(){
  77.         return id;
  78.     }
  79.  
  80.     public String getOwner(){
  81.         return this.owner;
  82.     }
  83.  
  84.     public void setOwner(String owner){
  85.         this.owner = owner;
  86.     }
  87.  
  88.     public List<String> getAllowed(){
  89.         return this.allowed;
  90.     }
  91.  
  92.     public void setAllowed(List<String> allowed){
  93.         this.allowed = allowed;
  94.     }
  95.  
  96.     public String getPassword(){
  97.         return this.password;
  98.     }
  99.  
  100.     public void setPassword(String password){
  101.         this.password = password;
  102.     }
  103.  
  104.     public String getWorld(){
  105.         return this.world;
  106.     }
  107.  
  108.     public void setWorld(String world){
  109.         this.world = world;
  110.     }
  111.  
  112.     public int getX(){
  113.         return this.x;
  114.     }
  115.  
  116.     public void setX(int x){
  117.         this.x = x;
  118.     }
  119.  
  120.     public int getY(){
  121.         return this.y;
  122.     }
  123.  
  124.     public void setY(int y){
  125.         this.y = y;
  126.     }
  127.  
  128.     public int getZ(){
  129.         return this.z;
  130.     }
  131.  
  132.     public void setZ(int z){
  133.         this.z = z;
  134.     }
  135.  
  136.     public Lock getLock(){
  137.         return this;
  138.     }
  139.  
  140.     public void setLock(Lock lock){
  141.         this.owner = lock.owner;
  142.         this.allowed = lock.allowed;
  143.         this.password = lock.password;
  144.         this.world = lock.world;
  145.         this.x = lock.x;
  146.         this.y = lock.y;
  147.         this.z = lock.z;
  148.     }
  149. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement