java.lang.Object
org.springframework.boot.buildpack.platform.build.Cache
Direct Known Subclasses:
Cache.Bind, Cache.Volume

public class Cache extends Object
Details of a cache for use by the CNB builder.
Since:
2.6.0
Author:
Scott Frederick
  • Field Details

  • Method Details

    • getVolume

      public Cache.Volume getVolume()
      Return the details of the cache if it is a volume cache.
      Returns:
      the cache, or null if it is not a volume cache
    • getBind

      public Cache.Bind getBind()
      Return the details of the cache if it is a bind cache.
      Returns:
      the cache, or null if it is not a bind cache
    • volume

      public static Cache volume(String name)
      Create a new Cache that uses a volume with the provided name.
      Parameters:
      name - the cache volume name
      Returns:
      a new cache instance
    • volume

      public static Cache volume(VolumeName name)
      Create a new Cache that uses a volume with the provided name.
      Parameters:
      name - the cache volume name
      Returns:
      a new cache instance
    • bind

      public static Cache bind(String source)
      Create a new Cache that uses a bind mount with the provided source.
      Parameters:
      source - the cache bind mount source
      Returns:
      a new cache instance
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object