content: /*
   ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
   ~                                                                               ~
   ~ The MIT License (MIT)                                                         ~
   ~                                                                               ~
   ~ Copyright (c) 2015-2025 miaixz.org and other contributors.                    ~
   ~                                                                               ~
   ~ Permission is hereby granted, free of charge, to any person obtaining a copy  ~
   ~ of this software and associated documentation files (the "Software"), to deal ~
   ~ in the Software without restriction, including without limitation the rights  ~
   ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell     ~
   ~ copies of the Software, and to permit persons to whom the Software is         ~
   ~ furnished to do so, subject to the following conditions:                      ~
   ~                                                                               ~
   ~ The above copyright notice and this permission notice shall be included in    ~
   ~ all copies or substantial portions of the Software.                           ~
   ~                                                                               ~
   ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR    ~
   ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,      ~
   ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE   ~
   ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER        ~
   ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ~
   ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN     ~
   ~ THE SOFTWARE.                                                                 ~
   ~                                                                               ~
   ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
  */
  package org.miaixz.bus.cache.magic.annotation;
  
  import java.lang.annotation.*;
  import org.miaixz.bus.cache.magic.CacheExpire;
  import org.miaixz.bus.core.lang.Normal;
  
  /**
   * 缓存注解
   * <p>
   * 用于标记方法使用缓存功能。当方法被调用时，会先从缓存中查找结果， 如果缓存中没有，则执行方法并将结果存入缓存。
   * </p>
   *
   * @author Kimi Liu
   * @since Java 17+
   */
  @Documented
  @Retention(RetentionPolicy.RUNTIME)
  @Target(value = ElementType.METHOD)
  public @interface Cached {
  
      /**
       * 指定使用的缓存实现
       * <p>
       * 默认使用在CacheAspect中配置的第一个caches
       * </p>
       *
       * @return 缓存实现名称
       */
      String value() default Normal.EMPTY;
  
      /**
       * 指定每个键的前缀
       * <p>
       * 如果方法没有参数，prefix将作为该方法使用的常量键
       * </p>
       *
       * @return 键前缀
       */
      String prefix() default Normal.EMPTY;
  
      /**
       * 使用SpEL表达式
       * <p>
       * 当这个SpEL表达式为true时，该方法会使用缓存
       * </p>
       *
       * @return SpEL条件表达式
       */
      String condition() default Normal.EMPTY;
  
      /**
       * 过期时间
       * <p>
       * 时间单位：毫秒
       * </p>
       *
       * @return 过期时间（毫秒）
       */
      int expire() default CacheExpire.FOREVER;
  
  }
  