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

Camelcade / Perl5-IDEA / #525521551

26 May 2025 11:24AM UTC coverage: 82.32% (+0.001%) from 82.319%
#525521551

push

github

hurricup
Migrated to the presentation property

1 of 1 new or added line in 1 file covered. (100.0%)

148 existing lines in 15 files now uncovered.

30897 of 37533 relevant lines covered (82.32%)

0.82 hits per line

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

52.63
/plugin/core/src/main/java/com/perl5/lang/perl/util/PerlHashEntry.java
1
/*
2
 * Copyright 2015-2025 Alexandr Evstigneev
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

17
package com.perl5.lang.perl.util;
18

19
import com.intellij.psi.PsiElement;
20
import org.jetbrains.annotations.NotNull;
21
import org.jetbrains.annotations.Nullable;
22

23
import java.util.Objects;
24

25
/**
26
 * Represents hash pair - key and value
27
 */
28
public class PerlHashEntry {
1✔
29
  public @NotNull PsiElement keyElement;
30
  public @Nullable PsiElement valueElement;
31

32
  private PerlHashEntry(@NotNull PsiElement keyElement, @Nullable PsiElement valueElement) {
1✔
33
    this.keyElement = keyElement;
1✔
34
    this.valueElement = valueElement;
1✔
35
  }
1✔
36

37
  public @Nullable String getValueString() {
38
    return PerlScalarUtil.getStringContent(valueElement);
1✔
39
  }
40

41
  public boolean isComplete() {
42
    return valueElement != null;
1✔
43
  }
44

45
  public @NotNull PsiElement getNonNullValueElement() {
46
    assert valueElement != null : "This method should be invoked only after isComplete() check";
1✔
47
    return valueElement;
1✔
48
  }
49

50
  @Override
51
  public boolean equals(Object o) {
UNCOV
52
    if (this == o) return true;
×
53
    if (o == null || getClass() != o.getClass()) return false;
×
54

55
    PerlHashEntry pair = (PerlHashEntry)o;
×
56

UNCOV
57
    if (!keyElement.equals(pair.keyElement)) return false;
×
UNCOV
58
    return Objects.equals(valueElement, pair.valueElement);
×
59
  }
60

61
  @Override
62
  public int hashCode() {
63
    int result = keyElement.hashCode();
×
UNCOV
64
    result = 31 * result + (valueElement != null ? valueElement.hashCode() : 0);
×
UNCOV
65
    return result;
×
66
  }
67

68
  @Override
69
  public String toString() {
UNCOV
70
    return "PerlHashEntry{" +
×
71
           "keyElement=" + keyElement +
72
           ", valueElement=" + valueElement +
73
           '}';
74
  }
75

76
  public static PerlHashEntry create(@NotNull PsiElement key, @Nullable PsiElement value) {
77
    return new PerlHashEntry(key, value);
1✔
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