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

ExpediaGroup / bull / #1032

10 Sep 2024 01:09PM UTC coverage: 100.0%. Remained the same
#1032

push

web-flow
Bump org.jboss.logging:jboss-logging from 3.6.0.Final to 3.6.1.Final (#522)

* Bump org.jboss.logging:jboss-logging from 3.6.0.Final to 3.6.1.Final

Bumps [org.jboss.logging:jboss-logging](https://github.com/jboss-logging/jboss-logging) from 3.6.0.Final to 3.6.1.Final.
- [Release notes](https://github.com/jboss-logging/jboss-logging/releases)
- [Commits](https://github.com/jboss-logging/jboss-logging/compare/3.6.0.Final...3.6.1.Final)

---
updated-dependencies:
- dependency-name: org.jboss.logging:jboss-logging
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Trigger notification

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Fabio Borriello <fborriello@expediagroup.com>

1198 of 1198 relevant lines covered (100.0%)

1.95 hits per line

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

100.0
/bull-bean-transformer/src/main/java/com/expediagroup/beans/populator/OptionalPopulator.java
1
/**
2
 * Copyright (C) 2019-2023 Expedia, Inc.
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
package com.expediagroup.beans.populator;
17

18
import static java.util.Optional.ofNullable;
19

20
import java.lang.reflect.Field;
21
import java.util.Optional;
22

23
import com.expediagroup.beans.transformer.BeanTransformer;
24

25
/**
26
 * Populator for {@link Optional} type.
27
 */
28
class OptionalPopulator extends Populator<Object> {
29

30
    /**
31
     * Default constructor.
32
     * @param beanTransformer the bean transformer containing the field name mapping and transformation functions
33
     */
34
    OptionalPopulator(final BeanTransformer beanTransformer) {
35
        super(beanTransformer);
2✔
36
    }
2✔
37

38
    /**
39
     * {@inheritDoc}
40
     */
41
    @Override
42
    public Object getPopulatedObject(final Field field, final Object fieldValue) {
43
        Object res = null;
2✔
44
        var optionalFieldValue = (Optional) fieldValue;
2✔
45
        if (optionalFieldValue.isPresent()) {
2✔
46
            res = transform(optionalFieldValue.get(), field.getType());
2✔
47
        }
48
        // if the field type in the target class is not an optional it puts the value inside an optional
49
        if (field.getType() == Optional.class) {
2✔
50
            res = ofNullable(res);
2✔
51
        }
52
        return res;
2✔
53
    }
54
}
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