• 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/event/Registration.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.event;
17

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

20
import javax.cache.configuration.CacheEntryListenerConfiguration;
21
import javax.cache.configuration.MutableCacheEntryListenerConfiguration;
22
import javax.cache.event.CacheEntryEventFilter;
23
import javax.cache.event.CacheEntryListener;
24

25
import org.jspecify.annotations.Nullable;
26

27
/**
28
 * The registration of a {@link CacheEntryListener} for event dispatching.
29
 *
30
 * @author ben.manes@gmail.com (Ben Manes)
31
 */
32
@SuppressWarnings("ClassEscapesDefinedScope")
33
public final class Registration<K, V> {
34
  private final CacheEntryListenerConfiguration<K, V> configuration;
35
  private final EventTypeAwareListener<K, V> listener;
36
  private final CacheEntryEventFilter<K, V> filter;
37

38
  public Registration(CacheEntryListenerConfiguration<K, V> configuration,
39
      CacheEntryEventFilter<K, V> filter, EventTypeAwareListener<K, V> listener) {
×
40
    this.configuration = new MutableCacheEntryListenerConfiguration<>(configuration);
×
41
    this.listener = requireNonNull(listener);
×
42
    this.filter = requireNonNull(filter);
×
43
  }
×
44

45
  /** Returns the configuration. */
46
  public CacheEntryListenerConfiguration<K, V> getConfiguration() {
47
    return configuration;
×
48
  }
49

50
  /** Returns the registered listener. */
51
  public EventTypeAwareListener<K, V> getCacheEntryListener() {
52
    return listener;
×
53
  }
54

55
  /** Returns the registered filter. */
56
  public CacheEntryEventFilter<K, V> getCacheEntryFilter() {
57
    return filter;
×
58
  }
59

60
  /** See {@link CacheEntryListenerConfiguration#isSynchronous()}. */
61
  public boolean isSynchronous() {
62
    return configuration.isSynchronous();
×
63
  }
64

65
  @Override
66
  public boolean equals(@Nullable Object o) {
67
    if (o == this) {
×
68
      return true;
×
69
    } else if (!(o instanceof Registration)) {
×
70
      return false;
×
71
    }
72
    var other = (Registration<?, ?>) o;
×
73
    return configuration.equals(other.configuration);
×
74
  }
75

76
  @Override
77
  public int hashCode() {
78
    return configuration.hashCode();
×
79
  }
80
}
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