1 43 package net.jforum.entities; 44 45 49 public class QuotaLimit 50 { 51 public static final int KB = 1; 52 public static final int MB = 2; 53 54 private int id; 55 private String description; 56 private int size; 57 private int type; 58 59 67 public boolean exceedsQuota(long size) 68 { 69 if (this.type == QuotaLimit.KB) { 70 return (size > this.size * 1024); 71 } 72 73 return (size > this.size * 1024 * 1024); 74 } 75 76 public int getSizeInBytes() 77 { 78 if (this.type == QuotaLimit.KB) { 79 return (this.size * 1024); 80 } 81 82 return (this.size * 1024 * 1024); 83 } 84 85 88 public String getDescription() 89 { 90 return this.description; 91 } 92 93 96 public void setDescription(String description) 97 { 98 this.description = description; 99 } 100 101 104 public int getId() 105 { 106 return this.id; 107 } 108 109 112 public void setId(int id) 113 { 114 this.id = id; 115 } 116 117 120 public int getSize() 121 { 122 return this.size; 123 } 124 125 128 public void setSize(int size) 129 { 130 this.size = size; 131 } 132 133 136 public int getType() 137 { 138 return this.type; 139 } 140 141 144 public void setType(int type) 145 { 146 this.type = type; 147 } 148 } 149 | Popular Tags |