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

leeonky / test-charm-java / 218

15 Apr 2025 02:45PM UTC coverage: 74.045% (-0.04%) from 74.088%
218

push

circleci

leeonky
Introduce adaptiveList

20 of 21 new or added lines in 3 files covered. (95.24%)

34 existing lines in 11 files now uncovered.

7968 of 10761 relevant lines covered (74.05%)

0.74 hits per line

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

76.47
/DAL-java/src/main/java/com/github/leeonky/dal/runtime/PropertyAccessor.java
1
package com.github.leeonky.dal.runtime;
2

3
import com.github.leeonky.dal.runtime.RuntimeContextBuilder.DALRuntimeContext;
4
import com.github.leeonky.util.BeanClass;
5
import com.github.leeonky.util.Sneaky;
6

7
import java.util.Objects;
8
import java.util.Set;
9

10
import static com.github.leeonky.dal.runtime.DalException.buildUserRuntimeException;
11

12
public interface PropertyAccessor<T> {
13

14
    default Data<?> getData(Data<T> data, Object property, DALRuntimeContext context) {
15
        Object result = null;
1✔
16
        try {
17
            result = getValue(data, property);
1✔
18
        } catch (InvalidPropertyException e) {
1✔
19
            try {
20
                result = context.currying(data.instance(), property).orElseThrow(() -> e).resolve();
1✔
21
            } catch (Throwable e1) {
1✔
UNCOV
22
                Sneaky.sneakyThrow(buildUserRuntimeException(e1));
×
23
            }
1✔
24
        } catch (Throwable e) {
1✔
UNCOV
25
            Sneaky.sneakyThrow(buildUserRuntimeException(e));
×
26
        }
1✔
27
        SchemaType schemaType = data.propertySchema(property, data.instanceOf(AutoMappingList.class) && property instanceof String);
1✔
28
        return context.data(result, schemaType);
1✔
29
    }
30

31
    default Object getValue(Data<T> data, Object property) {
32
        return getValue(data.instance(), property);
1✔
33
    }
34

35
    default Object getValue(T instance, Object property) {
UNCOV
36
        return BeanClass.createFrom(instance).getPropertyValue(instance, String.valueOf(property));
×
37
    }
38

39
    default Set<?> getPropertyNames(Data<T> data) {
40
        return getPropertyNames(data.instance());
1✔
41
    }
42

43
    default Set<?> getPropertyNames(T instance) {
UNCOV
44
        return BeanClass.createFrom(instance).getPropertyReaders().keySet();
×
45
    }
46

47
    default boolean isNull(T instance) {
48
        return Objects.equals(instance, null);
1✔
49
    }
50
}
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