Skip to content

Package: StorableIdImpl

StorableIdImpl

nameinstructionbranchcomplexitylinemethod
StorableIdImpl(String)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
equals(Object)
M: 35 C: 0
0%
M: 10 C: 0
0%
M: 6 C: 0
0%
M: 10 C: 0
0%
M: 1 C: 0
0%
hashCode()
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
toString()
M: 3 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) 2016, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.storable.model.id;
14:
15: import java.util.Objects;
16:
17: /**
18: * {@link StorableId} implementation.
19: *
20: * @since 1.0.0
21: */
22: public class StorableIdImpl implements StorableId {
23:
24: private final String id;
25:
26: /**
27: * Constructor.
28: *
29: * @param id The {@link StorableId} in {@link String} form.
30: * @since 1.0.0
31: */
32: public StorableIdImpl(String id) {
33: this.id = id;
34: }
35:
36: @Override
37: public String toString() {
38: return id;
39: }
40:
41: @Override
42: public boolean equals(Object obj) {
43:• if (this == obj) {
44: return true;
45: }
46:• if (obj == null) {
47: return false;
48: }
49:• if (getClass() != obj.getClass()) {
50: return false;
51: }
52: StorableIdImpl other = (StorableIdImpl) obj;
53:• if (id == null) {
54:• return other.id == null;
55: }
56:
57: return id.equals(other.id);
58: }
59:
60: @Override
61: public int hashCode() {
62: return Objects.hash(id);
63: }
64: }