Class CacheKey

java.lang.Object
org.apache.sis.metadata.CacheKey

final class CacheKey extends Object
A key in the MetadataStandard internal cache.
Since:
0.8
Version:
0.8
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final Class<?>
    If the type is an implementation class of a property, then the type declared in the signature for that property.
    (package private) final Class<?>
    The metadata class (interface or implementation) for which a PropertyAccessor will be associated.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CacheKey(Class<?> type)
    Creates a new key without information on the property type.
    CacheKey(Class<?> type, Class<?> propertyType)
    Creates a new key to use in the cache.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compares this key with the given object for equality.
    int
    Returns a hash code value for this key.
    (package private) final String
    Creates an error message for an invalid key.
    (package private) final boolean
    Returns true if the type can possibly be a value of a property of type propertyType.
    Returns a string representation for debugging purpose only.
    (package private) final String
    Creates an error message for an unrecognized type.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • type

      final Class<?> type
      The metadata class (interface or implementation) for which a PropertyAccessor will be associated. May be null if unknown, in which case isValid() returns false.
    • propertyType

      final Class<?> propertyType
      If the type is an implementation class of a property, then the type declared in the signature for that property. This information allows to handle classes that implement more than one metadata interfaces for their convenience. Some examples are found in the org.apache.sis.internal.simple package.

      This field shall never be null. If there is no property type information, then this field shall be set to Object.class.

  • Constructor Details

    • CacheKey

      CacheKey(Class<?> type)
      Creates a new key without information on the property type.
    • CacheKey

      CacheKey(Class<?> type, Class<?> propertyType)
      Creates a new key to use in the cache.
  • Method Details

    • isValid

      final boolean isValid()
      Returns true if the type can possibly be a value of a property of type propertyType.
    • hashCode

      public int hashCode()
      Returns a hash code value for this key.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Compares this key with the given object for equality.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Returns a string representation for debugging purpose only.
      Overrides:
      toString in class Object
    • unrecognized

      final String unrecognized()
      Creates an error message for an unrecognized type.
    • invalid

      final String invalid()
      Creates an error message for an invalid key.