Enum ReplicaType
- java.lang.Object
-
- java.lang.Enum<ReplicaType>
-
- dk.netarkivet.common.distribute.arcrepository.ReplicaType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ReplicaType>
public enum ReplicaType extends java.lang.Enum<ReplicaType>
Enumeration of the possible replica types used for replicas.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BITARCHIVE
bitarchive replica which contain files stored in repository.CHECKSUM
Checksum replica which contains checksums of files in repository.NO_REPLICA_TYPE
If no replica type has been set.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BITARCHIVE_REPLICATYPE_AS_STRING
String representation of the ReplicaType.BITARCHIVE.static java.lang.String
CHECKSUM_REPLICATYPE_AS_STRING
String representation of the ReplicaType.CHECKSUM.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ReplicaType
fromOrdinal(int ordinal)
Helper method that gives a proper object from e.g.static ReplicaType
fromSetting(java.lang.String s)
Helper method that gives a proper object from e.g.static ReplicaType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ReplicaType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NO_REPLICA_TYPE
public static final ReplicaType NO_REPLICA_TYPE
If no replica type has been set.
-
BITARCHIVE
public static final ReplicaType BITARCHIVE
bitarchive replica which contain files stored in repository.
-
CHECKSUM
public static final ReplicaType CHECKSUM
Checksum replica which contains checksums of files in repository.
-
-
Field Detail
-
BITARCHIVE_REPLICATYPE_AS_STRING
public static final java.lang.String BITARCHIVE_REPLICATYPE_AS_STRING
String representation of the ReplicaType.BITARCHIVE.- See Also:
- Constant Field Values
-
CHECKSUM_REPLICATYPE_AS_STRING
public static final java.lang.String CHECKSUM_REPLICATYPE_AS_STRING
String representation of the ReplicaType.CHECKSUM.- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static ReplicaType[] 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 (ReplicaType c : ReplicaType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ReplicaType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
fromOrdinal
public static ReplicaType fromOrdinal(int ordinal)
Helper method that gives a proper object from e.g. settings.- Parameters:
ordinal
- a certain integer for a replica type- Returns:
- the ReplicaType related to a certain integer
- Throws:
ArgumentNotValid
- If argument rt does not correspond to a ReplicaType
-
fromSetting
public static ReplicaType fromSetting(java.lang.String s)
Helper method that gives a proper object from e.g. settings.- Parameters:
s
- A string representing a ReplicaType.- Returns:
- the ReplicaType related to a certain string; if the string does not correspond to a known replicatype, it returns NO_REPLICA_TYPE
- Throws:
ArgumentNotValid
- If argument s is null
-
-