001/** 002 * Copyright 2010-2014 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.common.util; 017 018public enum Size { 019 020 BYTE(1, "b", "bytes/s"), // 021 KB(1024, "k", "KB/s"), // 022 MB(1024 * Size.KB.getValue(), "m", "MB/s"), // 023 GB(1024 * Size.MB.getValue(), "g", "GB/s"), // 024 TB(1024 * Size.GB.getValue(), "t", "TB/s"), // 025 PB(1024 * Size.TB.getValue(), "p", "PB/s"), // 026 EB(1024 * Size.PB.getValue(), "e", "EB/s"); 027 028 private long value; 029 private String sizeLabel; 030 private String rateLabel; 031 032 private Size(long value, String sizeLabel, String rateLabel) { 033 this.value = value; 034 this.sizeLabel = sizeLabel; 035 this.rateLabel = rateLabel; 036 } 037 038 public long getValue() { 039 return value; 040 } 041 042 public String getSizeLabel() { 043 return sizeLabel; 044 } 045 046 public String getRateLabel() { 047 return rateLabel; 048 } 049 050}