Class AbstractLayoutSource.LayoutCacheHint

  • All Implemented Interfaces:
    CacheHint
    Enclosing class:
    AbstractLayoutSource

    protected static class AbstractLayoutSource.LayoutCacheHint
    extends java.lang.Object
    implements CacheHint
    This class serves as both CacheHint and Cache key. To act as CacheHint, it needs to implement getCacheStateId and setCacheStateId. To act as Cache key, it needs to provides the equals and hashCode methods.
    Since:
    MicroStrategy Web 8.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      LayoutCacheHint​(java.lang.String sourceLocation, LayoutParser layoutParser, LayoutSource layoutSource)
      The constructor of the LayoutCacheHint class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object anObject)
      Indicates whether some other object is "equal to" this one.
      java.lang.Long getCacheStateId​(java.lang.String name)
      This method returns an cache state id of zero.
      int hashCode()
      Returns a hash code value for the object.
      void setCacheStateId​(java.lang.String name, java.lang.Long stateId)
      This method is a no-op.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LayoutCacheHint

        public LayoutCacheHint​(java.lang.String sourceLocation,
                               LayoutParser layoutParser,
                               LayoutSource layoutSource)
        The constructor of the LayoutCacheHint class. The source location and the fully qualified class name of the layout parser are used as keys
        Parameters:
        sourceLocation - the layout location
        layoutParser - the layout parser
        layoutSource - the layout source
    • Method Detail

      • getCacheStateId

        public java.lang.Long getCacheStateId​(java.lang.String name)
        This method returns an cache state id of zero.
        Specified by:
        getCacheStateId in interface CacheHint
        Parameters:
        name - the cache name
        Returns:
        the state id
      • setCacheStateId

        public void setCacheStateId​(java.lang.String name,
                                    java.lang.Long stateId)
        This method is a no-op.
        Specified by:
        setCacheStateId in interface CacheHint
        Parameters:
        name - the cache name
        stateId - the cache state id
      • equals

        public boolean equals​(java.lang.Object anObject)
        Indicates whether some other object is "equal to" this one. This method uses the layout source location and layout parser name to compare the equalness of two LayoutCacheHint.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        anObject - another LayoutCacheHint.
        Returns:
        true if the current LayoutCacheHint is equal to the object passed in.
      • hashCode

        public int hashCode()
        Returns a hash code value for the object. This method "xor" the hash codes of the source location and the parser class name.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        a hash code value for this object.