Coverage Report - org.jscsi.target.scsi.cdb.DefectListFormat
 
Classes in this File Line Coverage Branch Coverage Complexity
DefectListFormat
0%
0/10
0%
0/4
2
 
 1  
 package org.jscsi.target.scsi.cdb;
 2  
 
 3  
 /**
 4  
  * If the {@link FormatUnitCDB#formatData} bit is set to one, then the DEFECT LIST FORMAT field specifies the format of
 5  
  * the address descriptors in the defect list.
 6  
  * <p>
 7  
  * The DEFECT LIST FORMAT field has a length of 3 bits.
 8  
  * 
 9  
  * @author Andreas Ergenzinger
 10  
  */
 11  0
 public enum DefectListFormat {
 12  0
     SHORT_BLOCK((byte) 0), LONG_BLOCK((byte) 3), BYTES_FROM_INDEX((byte) 4), PHYSICAL_SECTOR((byte) 5), VENDOR_SPECIFIC((byte) 6);
 13  
     // all other values are RESERVED
 14  
 
 15  
     private final byte value;
 16  
 
 17  0
     private DefectListFormat (byte value) {
 18  0
         this.value = value;
 19  0
     }
 20  
 
 21  
     public byte getValue () {
 22  0
         return value;
 23  
     }
 24  
 
 25  
     public static DefectListFormat valueOf (int value) {
 26  0
         DefectListFormat[] values = values();
 27  0
         for (int i = 0; i < values.length; ++i)
 28  0
             if (values[i].getValue() == value) return values[i];
 29  0
         return null;
 30  
     }
 31  
 }