• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ben-manes / caffeine / #5173

29 Dec 2025 05:27AM UTC coverage: 0.0% (-100.0%) from 100.0%
#5173

push

github

ben-manes
speed up development ci build

0 of 3838 branches covered (0.0%)

0 of 7869 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/jcache/src/main/java/com/github/benmanes/caffeine/jcache/expiry/JCacheExpiryPolicy.java
1
/*
2
 * Copyright 2015 Ben Manes. All Rights Reserved.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package com.github.benmanes.caffeine.jcache.expiry;
17

18
import static java.util.Objects.requireNonNull;
19

20
import java.io.Serializable;
21
import java.util.Objects;
22

23
import javax.cache.expiry.Duration;
24
import javax.cache.expiry.ExpiryPolicy;
25

26
import org.jspecify.annotations.Nullable;
27

28
/**
29
 * A customized expiration policy.
30
 *
31
 * @author ben.manes@gmail.com (Ben Manes)
32
 */
33
public final class JCacheExpiryPolicy implements ExpiryPolicy, Serializable {
34
  private static final long serialVersionUID = 1L;
35

36
  private final Duration creation;
37
  private final @Nullable Duration update;
38
  private final @Nullable Duration access;
39

40
  public JCacheExpiryPolicy(Duration creation,
41
      @Nullable Duration update, @Nullable Duration access) {
×
42
    this.creation = requireNonNull(creation);
×
43
    this.update = update;
×
44
    this.access = access;
×
45
  }
×
46

47
  @Override
48
  public Duration getExpiryForCreation() {
49
    return creation;
×
50
  }
51

52
  @Override
53
  public @Nullable Duration getExpiryForUpdate() {
54
    return update;
×
55
  }
56

57
  @Override
58
  public @Nullable Duration getExpiryForAccess() {
59
    return access;
×
60
  }
61

62
  @Override
63
  public boolean equals(@Nullable Object o) {
64
    if (o == this) {
×
65
      return true;
×
66
    } else if (!(o instanceof ExpiryPolicy)) {
×
67
      return false;
×
68
    }
69
    var policy = (ExpiryPolicy) o;
×
70
    return Objects.equals(creation, policy.getExpiryForCreation())
×
71
        && Objects.equals(update, policy.getExpiryForUpdate())
×
72
        && Objects.equals(access, policy.getExpiryForAccess());
×
73
  }
74

75
  @Override
76
  public int hashCode() {
77
    return Objects.hash(creation, update, access);
×
78
  }
79
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc