Package net.sf.freecol.common.model
Enum Constants.IntegrityType
- java.lang.Object
-
- java.lang.Enum<Constants.IntegrityType>
-
- net.sf.freecol.common.model.Constants.IntegrityType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Constants.IntegrityType>
- Enclosing interface:
- Constants
public static enum Constants.IntegrityType extends java.lang.Enum<Constants.IntegrityType>
The result of checkIntegrity.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INTEGRITY_FAIL
INTEGRITY_FIXED
INTEGRITY_GOOD
-
Field Summary
Fields Modifier and Type Field Description private int
val
The magic value.
-
Constructor Summary
Constructors Modifier Constructor Description private
IntegrityType(int val)
Build an integrity type with the given value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Constants.IntegrityType
combine(Constants.IntegrityType it)
Combine this integrity with another.Constants.IntegrityType
fail()
Get the failed version of this integrity.Constants.IntegrityType
fix()
Get the fixed version of this integrity.boolean
safe()
Is this integrity safe (i.e.static Constants.IntegrityType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Constants.IntegrityType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INTEGRITY_FAIL
public static final Constants.IntegrityType INTEGRITY_FAIL
-
INTEGRITY_FIXED
public static final Constants.IntegrityType INTEGRITY_FIXED
-
INTEGRITY_GOOD
public static final Constants.IntegrityType INTEGRITY_GOOD
-
-
Method Detail
-
values
public static Constants.IntegrityType[] 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 (Constants.IntegrityType c : Constants.IntegrityType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Constants.IntegrityType 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
-
safe
public boolean safe()
Is this integrity safe (i.e. non-failed).- Returns:
- True if the integrity is safe.
-
combine
public Constants.IntegrityType combine(Constants.IntegrityType it)
Combine this integrity with another.- Parameters:
it
- The otherIntegrityType
.- Returns:
- The combined integrity.
-
fix
public Constants.IntegrityType fix()
Get the fixed version of this integrity. If the integrity is broken, nothing can happen.- Returns:
- The fixed
IntegrityType
.
-
fail
public Constants.IntegrityType fail()
Get the failed version of this integrity.- Returns:
- INTEGRITY_FAIL.
-
-