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 StringThe name of the public static field constant.private static final longFor 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 TypeMethodDescriptionbooleanCompares the name, which is okay since each name are unique.inthashCode()Returns a hash code derived from the name, which is okay since each name are unique.(package private) ObjectInvoked 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 theequalsmethod instead than the==operator.- Throws:
ObjectStreamException
-
equals
Compares the name, which is okay since each name are unique.- Overrides:
equalsin classProbeResult- Parameters:
object- the object to compare with thisProbeResult.- Returns:
trueif 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:
hashCodein classProbeResult
-
toString
Returns the constant name for debugging purpose.- Overrides:
toStringin classProbeResult
-