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

nats-io / json.java / #51

20 Jun 2025 03:37PM UTC coverage: 97.139% (-2.4%) from 99.519%
#51

push

github

web-flow
Merge pull request #18 from nats-io/revert

Revert back to Java 8 version

296 of 309 new or added lines in 5 files covered. (95.79%)

5 existing lines in 3 files now uncovered.

747 of 769 relevant lines covered (97.14%)

0.97 hits per line

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

50.0
/src/main/java/io/nats/json/JsonSerializable.java
1
// Copyright 2021-2024 The NATS Authors
2
// Licensed under the Apache License, Version 2.0 (the "License");
3
// you may not use this file except in compliance with the License.
4
// You may obtain a copy of the License at:
5
//
6
// http://www.apache.org/licenses/LICENSE-2.0
7
//
8
// Unless required by applicable law or agreed to in writing, software
9
// distributed under the License is distributed on an "AS IS" BASIS,
10
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
// See the License for the specific language governing permissions and
12
// limitations under the License.
13

14
package io.nats.json;
15

16
import java.nio.charset.StandardCharsets;
17

18
public interface JsonSerializable {
19
    String toJson();
20

21
    default byte[] serialize() {
UNCOV
22
        return toJson().getBytes(StandardCharsets.UTF_8);
×
23
    }
24

25
    default JsonValue toJsonValue() {
26
        return JsonParser.parseUnchecked(toJson());
1✔
27
    }
28
}
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