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

AuthMe / ConfigMe / 7041999669

30 Nov 2023 04:25AM UTC coverage: 99.413%. Remained the same
7041999669

Pull #401

github

web-flow
Bump actions/setup-java from 3 to 4

Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #401: Bump actions/setup-java from 3 to 4

527 of 540 branches covered (0.0%)

1524 of 1533 relevant lines covered (99.41%)

4.57 hits per line

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

100.0
/src/main/java/ch/jalu/configme/beanmapper/context/MappingContext.java
1
package ch.jalu.configme.beanmapper.context;
2

3
import ch.jalu.configme.beanmapper.ConfigMeMapperException;
4
import ch.jalu.configme.properties.convertresult.ConvertErrorRecorder;
5
import ch.jalu.typeresolver.TypeInfo;
6
import org.jetbrains.annotations.NotNull;
7

8
/**
9
 * Holds necessary information for a certain value that is being mapped in the bean mapper.
10
 */
11
public interface MappingContext {
12

13
    /**
14
     * Creates a child context with the given path addition ("name") and type information.
15
     *
16
     * @param name additional path element to append to this context's path
17
     * @param targetType the required type
18
     * @return new child context
19
     */
20
    @NotNull MappingContext createChild(@NotNull String name, @NotNull TypeInfo targetType);
21

22
    /**
23
     * Returns the path, from the root of the bean, that is being mapped. In other words, this is a local path
24
     * relative to the bean root. The bean root is always {@code ""} (empty string).
25
     *
26
     * @return local path of the bean currently being mapped
27
     */
28
    @NotNull String getBeanPath();
29

30
    /**
31
     * @return the type the value should be mapped to
32
     */
33
    @NotNull TypeInfo getTargetType();
34

35
    /**
36
     * Returns the target type as {@link Class}, throwing an exception if it cannot be converted.
37
     *
38
     * @return the target type as a class
39
     */
40
    default @NotNull Class<?> getTargetTypeAsClassOrThrow() {
41
        Class<?> targetClass = getTargetType().toClass();
4✔
42
        if (targetClass == null) {
2✔
43
            throw new ConfigMeMapperException(this, "The target type cannot be converted to a class");
6✔
44
        }
45
        return targetClass;
2✔
46
    }
47

48
    /**
49
     * Convenience method: returns the type argument at the given index, guaranteeing that it exists
50
     * and that it can be converted to a safe-to-write class. Throws an exception otherwise.
51
     *
52
     * @param index the index to get generic type info for
53
     * @return the generic type info (throws exception if absent or not precise enough)
54
     */
55
    default @NotNull TypeInfo getTargetTypeArgumentOrThrow(int index) {
56
        TypeInfo typeArgument = getTargetType().getTypeArgumentInfo(index);
5✔
57
        if (typeArgument == null || typeArgument.toClass() == null) {
5✔
58
            throw new ConfigMeMapperException(this, "The type argument at index " + index + " is not well defined");
15✔
59
        }
60
        return typeArgument;
2✔
61
    }
62

63
    /**
64
     * @return textual representation of the info in the context, used in exceptions
65
     */
66
    @NotNull String createDescription();
67

68
    /**
69
     * Registers an error during the mapping process, which delegates to the supplied
70
     * {@link ch.jalu.configme.properties.convertresult.ConvertErrorRecorder ConvertErrorRecorder},
71
     * associated to the property this conversion is being performed for.
72
     *
73
     * @param reason the error reason (ignored by the default context implementation)
74
     */
75
    default void registerError(@NotNull String reason) {
76
        getErrorRecorder().setHasError("For bean path '" + getBeanPath() + "': " + reason);
16✔
77
    }
1✔
78

79
    /**
80
     * @return error recorder to register errors even when a value can be created
81
     */
82
    @NotNull ConvertErrorRecorder getErrorRecorder();
83
}
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

© 2025 Coveralls, Inc