Top Description Fields Constructors Methods
net.sf.ehcache

public final Class Status

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable

A pre JDK1.5 compatible enum class to indicate the status of a CacheManager or Cache.

ehcache historically used int values for status. This is unsuitable for third party use thus this class. Methods are provided to convert from the int status values to enum values and vice versa.

Author
Greg Luck
Since
1.2
Version
$Id: Status.java 10789 2018-04-26 02:08:13Z adahanne $

Field Summary

Modifier and TypeField and Description
private final int
private final String
private static final long
public static final Status
STATUS_ALIVE

The cache is alive.

public static final Status
STATUS_SHUTDOWN

The cache is shudown.

public static final Status
STATUS_UNINITIALISED

The cache is uninitialised.

private static final Status[]

Constructor Summary

AccessConstructor and Description
private
Status(int intValue, String name)

Method Summary

Modifier and TypeMethod and Description
public static Status

Returns:

an enum Status
convertIntToStatus
(int
an int argument between 1 and 3.
statusAsInt
)

public boolean

Returns:

true if this object is the same as the obj argument; false otherwise.
equals
(Object
the reference object with which to compare.
object
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public boolean

Returns:

true is the statuses are the same
equals
(Status
the status to check
status
)

Equality checker when the comparison object is of the same type.

public int

Returns:

a hash code value for this object.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value for Status.
public int

Returns:

the int value of this status.
intValue
()

Returns the int value of status, for backward compatibility with ehcache versions below 1.2

public String

Returns:

a string representation of the object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

intValueback to summary
private final int intValue
nameback to summary
private final String name
serialVersionUIDback to summary
private static final long serialVersionUID
STATUS_ALIVEback to summary
public static final Status STATUS_ALIVE

The cache is alive. It can be used.

STATUS_SHUTDOWNback to summary
public static final Status STATUS_SHUTDOWN

The cache is shudown. It cannot be used.

STATUS_UNINITIALISEDback to summary
public static final Status STATUS_UNINITIALISED

The cache is uninitialised. It cannot be used.

STATUSESback to summary
private static final Status[] STATUSES

Constructor Detail

Statusback to summary
private Status(int intValue, String name)

Method Detail

convertIntToStatusback to summary
public static Status convertIntToStatus(int statusAsInt) throws IllegalArgumentException
Parameters
statusAsInt:int

an int argument between 1 and 3.

Returns:Status

an enum Status

Exceptions
IllegalArgumentException:
if the argument is not between 1 and 3
equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.
The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Parameters
object:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

See Also
hashCode(), java.util.Hashtable
equalsback to summary
public boolean equals(Status status)

Equality checker when the comparison object is of the same type.

Parameters
status:Status

the status to check

Returns:boolean

true is the statuses are the same

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for Status. It is the underlying int value of the status.

Returns:int

a hash code value for this object.

See Also
Object#hashCode(), java.util.Hashtable
intValueback to summary
public int intValue()

Returns the int value of status, for backward compatibility with ehcache versions below 1.2

Returns:int

the int value of this status.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns:String

a string representation of the object.