Class ProbeResult.Constant

java.lang.Object
org.apache.sis.storage.ProbeResult
org.apache.sis.storage.ProbeResult.Constant
All Implemented Interfaces:
Serializable
Enclosing class:
ProbeResult

private static final class ProbeResult.Constant extends 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 Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • name

      private final String 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

      Object readResolve() throws ObjectStreamException
      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 the equals method instead than the == operator.
      Throws:
      ObjectStreamException
    • equals

      public boolean equals(Object object)
      Compares the name, which is okay since each name are unique.
      Overrides:
      equals in class ProbeResult
      Parameters:
      object - the object to compare with this ProbeResult.
      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 class ProbeResult
    • toString

      public String toString()
      Returns the constant name for debugging purpose.
      Overrides:
      toString in class ProbeResult