Enum BlockStatus
- java.lang.Object
-
- java.lang.Enum<BlockStatus>
-
- org.johnnei.javatorrent.torrent.files.BlockStatus
-
- All Implemented Interfaces:
Serializable,Comparable<BlockStatus>
public enum BlockStatus extends Enum<BlockStatus>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description NeededThis status indicates that we still need this block and have not yet assigned it to a peer.RequestedThis status indicates that we still need this block and have requested it from a peer.StoredThis status indicates that we received and stored the bytes of this piece but thePieceas an entirety needs to be on this status before we can verify that the received information is correct.VerifiedThe block information we have is verified to match the expected data.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BlockStatusvalueOf(String name)Returns the enum constant of this type with the specified name.static BlockStatus[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
Needed
public static final BlockStatus Needed
This status indicates that we still need this block and have not yet assigned it to a peer.
-
Requested
public static final BlockStatus Requested
This status indicates that we still need this block and have requested it from a peer.
-
Stored
public static final BlockStatus Stored
This status indicates that we received and stored the bytes of this piece but thePieceas an entirety needs to be on this status before we can verify that the received information is correct.
-
Verified
public static final BlockStatus Verified
The block information we have is verified to match the expected data.
-
-
Method Detail
-
values
public static BlockStatus[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BlockStatus c : BlockStatus.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BlockStatus valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
-