Package com.palantir.util.io
Enum AvailabilityRequirement
- java.lang.Object
-
- java.lang.Enum<AvailabilityRequirement>
-
- com.palantir.util.io.AvailabilityRequirement
-
- All Implemented Interfaces:
Serializable
,Comparable<AvailabilityRequirement>
public enum AvailabilityRequirement extends Enum<AvailabilityRequirement>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract int
calculateRequired(int total)
boolean
satisfies(int available, int total)
static AvailabilityRequirement
valueOf(String name)
Returns the enum constant of this type with the specified name.static AvailabilityRequirement[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ANY
public static final AvailabilityRequirement ANY
-
QUORUM
public static final AvailabilityRequirement QUORUM
-
-
Method Detail
-
values
public static AvailabilityRequirement[] 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 (AvailabilityRequirement c : AvailabilityRequirement.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AvailabilityRequirement 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
-
calculateRequired
protected abstract int calculateRequired(int total)
-
satisfies
public final boolean satisfies(int available, int total)
-
-