Skip to content

Package: TransportSet

TransportSet

nameinstructionbranchcomplexitylinemethod
static {...}
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Distribution License v. 1.0, which is available at
6: * http://www.eclipse.org/org/documents/edl-v10.php.
7: *
8: * SPDX-License-Identifier: BSD-3-Clause
9: */
10:
11: package com.sun.xml.ws.test.model;
12:
13: /**
14: * Set of transports.
15: *
16: * @author Kohsuke Kawaguchi
17: */
18: public interface TransportSet {
19: /**
20: * Checks if the given transport is contained in this set.
21: */
22: boolean contains(String transport);
23:
24: /**
25: * Constant that represents a set that includes everything.
26: */
27: public static final TransportSet ALL = new TransportSet() {
28: public boolean contains(String transport) {
29: return true;
30: }
31: };
32:
33: /**
34: * {@link TransportSet} that consists of a single value.
35: */
36: public static final class Singleton implements TransportSet {
37: private final String transport;
38:
39: public Singleton(String transport) {
40: this.transport = transport;
41: }
42:
43: public boolean contains(String transport) {
44: return this.transport.equals(transport);
45: }
46: }
47: }