Package org.apache.sis.storage
Class ProbeResult.Constant
java.lang.Object
org.apache.sis.storage.ProbeResult
org.apache.sis.storage.ProbeResult.Constant
- All Implemented Interfaces:
Serializable
- Enclosing class:
- ProbeResult
Implementation of static constants defined in
ProbeResult
.
We need a special implementation class in order to resolve deserialized instances to their unique instance.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
The name of the public static field constant.private static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.storage.ProbeResult
INSUFFICIENT_BYTES, SUPPORTED, UNDETERMINED, UNSUPPORTED_STORAGE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares the name, which is okay since each name are unique.int
hashCode()
Returns a hash code derived from the name, which is okay since each name are unique.(package private) Object
Invoked on deserialization for fetching the unique instance, if possible.toString()
Returns the constant name for debugging purpose.Methods inherited from class org.apache.sis.storage.ProbeResult
getMimeType, getVersion, isSupported
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
name
The name of the public static field constant. Each name shall be unique.
-
-
Constructor Details
-
Constant
Constant(boolean isSupported, String name) Creates a new constant for a public static field of the given name.
-
-
Method Details
-
readResolve
Invoked on deserialization for fetching the unique instance, if possible. If we fail to resolve (which may happen if the instance has been serialized by a more recent SIS version), returns the instance unchanged. It should be okay if all comparisons are performed by theequals
method instead than the==
operator.- Throws:
ObjectStreamException
-
equals
Compares the name, which is okay since each name are unique.- Overrides:
equals
in classProbeResult
- Parameters:
object
- the object to compare with thisProbeResult
.- Returns:
true
if the two objects are equal.
-
hashCode
public int hashCode()Returns a hash code derived from the name, which is okay since each name are unique.- Overrides:
hashCode
in classProbeResult
-
toString
Returns the constant name for debugging purpose.- Overrides:
toString
in classProbeResult
-